mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-20 14:21:00 +00:00
Add custom_head config to inject HTML in to page <head> (#350)
This commit is contained in:
parent
4547ed1c71
commit
69b0430819
3 changed files with 9 additions and 0 deletions
|
@ -235,6 +235,8 @@ class Config(models.Model):
|
||||||
|
|
||||||
restricted_usernames: str = "admin\nadmins\nadministrator\nadministrators\nsystem\nroot\nannounce\nannouncement\nannouncements"
|
restricted_usernames: str = "admin\nadmins\nadministrator\nadministrators\nsystem\nroot\nannounce\nannouncement\nannouncements"
|
||||||
|
|
||||||
|
custom_head: str | None
|
||||||
|
|
||||||
class UserOptions(pydantic.BaseModel):
|
class UserOptions(pydantic.BaseModel):
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
{% include "_opengraph.html" with opengraph_local=opengraph_defaults %}
|
{% include "_opengraph.html" with opengraph_local=opengraph_defaults %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block extra_head %}{% endblock %}
|
{% block extra_head %}{% endblock %}
|
||||||
|
{% block custom_head %}{% if config.custom_head %}{{ config.custom_head|safe }}{% endif %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body class="{% block body_class %}{% endblock %}" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
<body class="{% block body_class %}{% endblock %}" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
||||||
<a id='skip-to-main' class='screenreader-text' href='#main-content'>Skip to Content</a>
|
<a id='skip-to-main' class='screenreader-text' href='#main-content'>Skip to Content</a>
|
||||||
|
|
|
@ -101,6 +101,11 @@ class BasicSettings(AdminSettingsPage):
|
||||||
"title": "Show Public Timeline On Front Page",
|
"title": "Show Public Timeline On Front Page",
|
||||||
"help_text": "Whether to show some recent posts on the logged-out homepage",
|
"help_text": "Whether to show some recent posts on the logged-out homepage",
|
||||||
},
|
},
|
||||||
|
"custom_head": {
|
||||||
|
"title": "HTML <head> Extra",
|
||||||
|
"help_text": "Add custom HTML to the <head> of all pages (except /djadmin/).\nNote: This can break page rendering/layout.",
|
||||||
|
"display": "textarea",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
layout = {
|
layout = {
|
||||||
|
@ -110,6 +115,7 @@ class BasicSettings(AdminSettingsPage):
|
||||||
"site_icon",
|
"site_icon",
|
||||||
"site_banner",
|
"site_banner",
|
||||||
"highlight_color",
|
"highlight_color",
|
||||||
|
"custom_head",
|
||||||
],
|
],
|
||||||
"Signups": [
|
"Signups": [
|
||||||
"signup_allowed",
|
"signup_allowed",
|
||||||
|
|
Loading…
Reference in a new issue