From 95cee40b0fae0f8e2baa216f3cee4d7b7e350cce Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Tue, 23 Sep 2025 00:14:45 +0200 Subject: [PATCH] Use anchor heading attribute instead of bookHeadingAnchor --- exampleSite/content.en/_index.md | 3 +-- layouts/_markup/render-heading.html | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/exampleSite/content.en/_index.md b/exampleSite/content.en/_index.md index c9ff7ba..6b3f454 100644 --- a/exampleSite/content.en/_index.md +++ b/exampleSite/content.en/_index.md @@ -1,12 +1,11 @@ --- title: Introduction -bookHeadingAnchor: false layout: landing ---
-# HUGO BOOK +# HUGO BOOK {anchor=false} [Hugo](https://gohugo.io) documentation theme as simple as plain book {{< badge style="info" title="Badge" value="Value" >}} {{< badge style="default" title="Badge" value="Value" >}} diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html index d2b3c28..762a0f6 100644 --- a/layouts/_markup/render-heading.html +++ b/layouts/_markup/render-heading.html @@ -1,6 +1,6 @@ - - {{ .Text }} - {{ if default true .Page.Params.bookHeadingAnchor }} + + {{- .Text -}} + {{- if default true .Attributes.anchor }} # - {{ end }} + {{- end -}}