theme: add id to h1 elements #384

This commit is contained in:
Sören Weber 2022-11-13 22:33:55 +01:00
parent 5971d3d5fa
commit c7435b476b
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 10 additions and 5 deletions

View file

@ -30,7 +30,7 @@
<main id="body-inner" class="chapter" tabindex="-1"> <main id="body-inner" class="chapter" tabindex="-1">
<div class="flex-block-wrapper"> <div class="flex-block-wrapper">
<article class="default"> <article class="default">
<h1>{{ T "title-404" }}</h1> <h1 id="{{ T "title-404" | urlize }}">{{ T "title-404" }}</h1>
<p></p> <p></p>
<p>{{ T "message-404" }}</p> <p>{{ T "message-404" }}</p>
<p></p> <p></p>

View file

@ -3,7 +3,12 @@
<article> <article>
{{- $page := . }} {{- $page := . }}
<h1>{{ if eq .Kind "term" }}{{ .Data.Singular | humanize }} {{ default "::" .Site.Params.titleSeparator }} {{ end }}{{ .Title }}</h1> {{- $title := "" }}
{{- if eq .Kind "term" }}
{{- $title = printf "%s %s " (.Data.Singular | humanize) (default "::" .Site.Params.titleSeparator) }}
{{- end }}
{{- $title = printf "%s%s" $title .Title }}
<h1 id="{{ $title | urlize }}">{{ $title }}</h1>
<ul> <ul>
{{- range .Data.Terms.Alphabetical }} {{- range .Data.Terms.Alphabetical }}
{{- $len := 0 }} {{- $len := 0 }}

View file

@ -3,7 +3,7 @@
{{- with $page }} {{- with $page }}
<article class="chapter"> <article class="chapter">
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div> {{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
<h1>{{ .Title }}</h1>{{ partial "heading-post.html" . }} <h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
{{ $content | safeHTML }} {{ $content | safeHTML }}
<footer class="footline"> <footer class="footline">

View file

@ -2,7 +2,7 @@
{{- $content := .content }} {{- $content := .content }}
{{- with $page }} {{- with $page }}
<article class="default"> <article class="default">
{{ partial "heading-pre.html" . }}<h1>{{ .Title }}</h1>{{ partial "heading-post.html" . }} {{ partial "heading-pre.html" . }}<h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
{{ $content | safeHTML }} {{ $content | safeHTML }}
<footer class="footline"> <footer class="footline">

View file

@ -2,7 +2,7 @@
{{- $content := .content }} {{- $content := .content }}
{{- with $page }} {{- with $page }}
<article class="home"> <article class="home">
{{ partial "heading-pre.html" . }}<h1>{{ .Title }}</h1>{{ partial "heading-post.html" . }} {{ partial "heading-pre.html" . }}<h1 id="{{ .Title | urlize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
{{ $content | safeHTML }} {{ $content | safeHTML }}
<footer class="footline"> <footer class="footline">