Skip to content

Head extras#36

Merged
fpichardom merged 5 commits intomainfrom
head_extras
Mar 4, 2026
Merged

Head extras#36
fpichardom merged 5 commits intomainfrom
head_extras

Conversation

@fpichardom
Copy link
Contributor

Allows to add extra content to head of pages. This allows to add custom scripts such as Google Analytics.

Implement a mechanism to inject custom HTML (e.g., analytics scripts) into the <head> section via an optional extra_head.html file. The file is cached after first read to avoid repeated I/O operations.
Return Markup objects from get_extra_head_html() helper to eliminate the need for the `| safe` filter and conditional check in the template. This streamlines the template code while maintaining the same functionality.
…tra head HTML

Replace h.get_extra_head_html() helper call with direct template include to simplify the implementation while maintaining the same functionality for injecting custom head HTML.
…tra head HTML

Replace {% include "extra_head.html" ignore missing %} with h.get_extra_head_html() helper call to centralize the logic for injecting custom head HTML. Also normalize indentation in styles block.
@fpichardom fpichardom merged commit f8d267d into main Mar 4, 2026
0 of 2 checks passed
@fpichardom fpichardom deleted the head_extras branch March 4, 2026 19:33
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