Use anchor heading attribute instead of bookHeadingAnchor

This commit is contained in:
Alex Shpak
2025-09-23 00:14:45 +02:00
parent 6ba59e191d
commit 95cee40b0f
2 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -1,12 +1,11 @@
--- ---
title: Introduction title: Introduction
bookHeadingAnchor: false
layout: landing layout: landing
--- ---
<div class="book-hero"> <div class="book-hero">
# HUGO BOOK # HUGO BOOK {anchor=false}
[Hugo](https://gohugo.io) documentation theme as simple as plain book [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" >}} {{< badge style="info" title="Badge" value="Value" >}} {{< badge style="default" title="Badge" value="Value" >}}
+4 -4
View File
@@ -1,6 +1,6 @@
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}> <h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class -}}class="{{ . }}"{{- end -}}>
{{ .Text }} {{- .Text -}}
{{ if default true .Page.Params.bookHeadingAnchor }} {{- if default true .Attributes.anchor }}
<a class="anchor" href="#{{ .Anchor }}">#</a> <a class="anchor" href="#{{ .Anchor }}">#</a>
{{ end }} {{- end -}}
</h{{ .Level }}> </h{{ .Level }}>