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/single.html | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/layouts/single.html b/layouts/single.html
index e8d029c..83cdd7c 100644
--- a/layouts/single.html
+++ b/layouts/single.html
@@ -8,7 +8,14 @@
{{- $needs_aside := or .Params.toc $related_content -}}
{{ $page := .}}
{{ $section := .Site.GetPage "section" .Section }}
- <article class="flex-l {{ if $needs_aside }}mw8{{ else }}mw7{{ end }} center ph3 flex-wrap justify-between">
+
+ {{/* Calculate a unique class for this post */}}
+ {{- $post_class := "" -}}
+ {{- with .File -}}
+ {{- $post_class = printf "page-%s" .ContentBaseName -}}
+ {{- end -}}
+
+ <article class="{{ $post_class }} flex-l {{ if $needs_aside }}mw8{{ else }}mw7{{ end }} center ph3 flex-wrap justify-between">
<header class="mt4 w-100">
<aside class="instapaper_ignoref b helvetica tracked ttu">
{{/*
@@ -80,4 +87,4 @@
{{- end -}}
</article>
-{{ end }}
+{{ end }}
\ No newline at end of file
--
Gitblit v1.10.0