@@ -198,6 +198,7 @@ Rustipo injects common site variables into template contexts, including:
198198 - ` next_url `
199199- favicon helpers: ` site_favicon ` , ` site_favicon_svg ` , ` site_favicon_ico ` , ` site_apple_touch_icon `
200200- asset helper: ` site_asset_version ` (stable cache-busting fingerprint for generated asset URLs)
201+ - analytics helper: ` site_analytics_head_html ` (optional provider-agnostic head snippet for configured analytics)
201202- style helpers from config:
202203 - ` site_style.content_width `
203204 - ` site_style.top_gap `
@@ -216,6 +217,25 @@ Rustipo injects common site variables into template contexts, including:
216217
217218If both values are empty, Rustipo leaves ` page_description ` unset so themes can omit the tag cleanly.
218219
220+ ` site_analytics_head_html ` is the stable hook for built-in analytics integrations. In ` v0.15 ` ,
221+ Rustipo supports opt-in Plausible analytics via:
222+
223+ ``` toml
224+ [site .analytics .plausible ]
225+ domain = " docs.example.com"
226+ # Optional for self-hosted Plausible:
227+ # script_src = "https://stats.example.com/js/script.js"
228+ ```
229+
230+ When present, Rustipo renders a ready-to-include head snippet. Themes can inherit the built-in
231+ head partial behavior or explicitly render:
232+
233+ ``` html
234+ {% if site_analytics_head_html %}
235+ {{ site_analytics_head_html | safe }}
236+ {% endif %}
237+ ```
238+
219239Rustipo also registers small Tera helpers for theme authors:
220240
221241- ` slugify ` filter
0 commit comments