From 62aa99f85bc98ca97ca4f798dfc8b0d507c0fb4b Mon Sep 17 00:00:00 2001
From: Kamisama <166204452+NITHINSPACETIME@users.noreply.github.com>
Date: Sun, 18 Jan 2026 04:54:49 +0000
Subject: [PATCH] feat: add dynamic identifiers to body and article classes per page (#887)
---
layouts/page/single.html | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/layouts/page/single.html b/layouts/page/single.html
index 86660c9..27bd09f 100644
--- a/layouts/page/single.html
+++ b/layouts/page/single.html
@@ -1,7 +1,13 @@
{{ define "header" }}{{ partials.Include "page-header.html" . }}{{ end }}
{{ define "main" }}
<div class="flex-l mt2 mw8 center">
- <article class="center cf pv5 ph3 ph4-ns mw7">
+ {{/* Calculate a unique class for this page */}}
+ {{- $post_class := "" -}}
+ {{- with .File -}}
+ {{- $post_class = printf "page-%s" .ContentBaseName -}}
+ {{- end -}}
+
+ <article class="{{ $post_class }} center cf pv5 ph3 ph4-ns mw7">
<header>
<h1 class="f1">
{{ .Title }}
@@ -12,4 +18,4 @@
</div>
</article>
</div>
-{{ end }}
+{{ end }}
\ No newline at end of file
--
Gitblit v1.10.0