Skip to content

feat: allow extra_head and custom content additions#1

Open
mladedav wants to merge 3 commits intomxaddict:mainfrom
mladedav:main
Open

feat: allow extra_head and custom content additions#1
mladedav wants to merge 3 commits intomxaddict:mainfrom
mladedav:main

Conversation

@mladedav
Copy link
Copy Markdown

I want to inject custom script tags into head and body. For head, I have added a custom tag like hyde uses. Content can be overriden in base and it will be appended at the end of whatever extends base.

This allows users to override base.html like this:

{% extends "zolanight/templates/base.html" %}

{% block extra_head %}
<style>
  {# some css #}
</style>
{% endblock extra_head %}

{% block content %}
  {# some javascript #}
{% endblock content %}

@mladedav
Copy link
Copy Markdown
Author

It might be better to have another extra_body block instead of piggy-backing on content so that the script is guaranteed to be at the end of the page. I'm not sure though and did it this way to not introduce new blocks if they're not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant