From a58a496fd284622dcde608218dfac4d4d35f20cb Mon Sep 17 00:00:00 2001
From: Patrick Kollitsch <davidsneighbourdev+gh@gmail.com>
Date: Sat, 06 Jun 2026 01:21:36 +0000
Subject: [PATCH] feat: add layout and content hook points
---
layouts/_partials/head-additions.html | 8 ++++++++
layouts/page/single.html | 2 ++
layouts/baseof.html | 8 ++++++++
layouts/single.html | 2 ++
4 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/layouts/_partials/head-additions.html b/layouts/_partials/head-additions.html
index e69de29..c7d313c 100644
--- a/layouts/_partials/head-additions.html
+++ b/layouts/_partials/head-additions.html
@@ -0,0 +1,8 @@
+{{- /*
+ head-additions.html — the designated injection point at the end of <head>.
+
+ Site projects can override this partial directly, or use the "head-end" hook
+ to inject markup (meta tags, preloads, third-party <script>/<link> tags)
+ without overriding the partial. See the documentation on hooks & filters.
+*/ -}}
+{{- partials.Include "hook.html" (dict "hook" "head-end" "context" .) -}}
diff --git a/layouts/baseof.html b/layouts/baseof.html
index 9932b8e..df2021a 100644
--- a/layouts/baseof.html
+++ b/layouts/baseof.html
@@ -72,11 +72,19 @@
{{- if .IsSection -}}{{- $body_classes = $body_classes | append "is-section" -}}{{- end -}}
<body class="{{ delimit $body_classes " " }}">
+ {{- partials.Include "hook.html" (dict "hook" "body-start" "context" .) -}}
+ {{- partials.Include "hook.html" (dict "hook" "header-before" "context" .) -}}
{{ block "header" . }}{{ partials.Include "site-header.html" .}}{{ end }}
+ {{- partials.Include "hook.html" (dict "hook" "header-after" "context" .) -}}
<main class="pb7" role="main">
+ {{- partials.Include "hook.html" (dict "hook" "main-before" "context" .) -}}
{{ block "main" . }}{{ end }}
+ {{- partials.Include "hook.html" (dict "hook" "main-after" "context" .) -}}
</main>
+ {{- partials.Include "hook.html" (dict "hook" "footer-before" "context" .) -}}
{{ block "footer" . }}{{ partials.IncludeCached "site-footer.html" . }}{{ end }}
+ {{- partials.Include "hook.html" (dict "hook" "footer-after" "context" .) -}}
+ {{- partials.Include "hook.html" (dict "hook" "body-end" "context" .) -}}
</body>
</html>
{{- with (templates.Defer (dict "key" "hooks-collector")) -}}
diff --git a/layouts/page/single.html b/layouts/page/single.html
index 27bd09f..681ec2e 100644
--- a/layouts/page/single.html
+++ b/layouts/page/single.html
@@ -14,7 +14,9 @@
</h1>
</header>
<div class="nested-copy-line-height lh-copy f4 nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }}">
+ {{- partials.Include "hook.html" (dict "hook" "content-before" "context" .) -}}
{{ .Content }}
+ {{- partials.Include "hook.html" (dict "hook" "content-after" "context" .) -}}
</div>
</article>
</div>
diff --git a/layouts/single.html b/layouts/single.html
index 7ee50ad..df117fe 100644
--- a/layouts/single.html
+++ b/layouts/single.html
@@ -72,7 +72,9 @@
{{ end }}
</header>
<div class="nested-copy-line-height lh-copy {{ $.Param "post_content_classes" | compare.Default "serif"}} f4 nested-links {{ $.Param "text_color" | compare.Default "mid-gray" }} {{ compare.Conditional (compare.Eq $.Site.Language.Direction "rtl") "pl4-l" "pr4-l" }} {{ if $needs_aside }}w-two-thirds-l{{ else }}w-100-l{{ end }}">
+ {{- partials.Include "hook.html" (dict "hook" "content-before" "context" .) -}}
{{- .Content -}}
+ {{- partials.Include "hook.html" (dict "hook" "content-after" "context" .) -}}
{{- partials.Include "tags.html" . -}}
{{ if .Site.Config.Services.Disqus.Shortname }}
<div class="mt6 instapaper_ignoref">
--
Gitblit v1.10.0