mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: make heading a template #744
This commit is contained in:
parent
76782d06e5
commit
ac985ee78c
7 changed files with 8 additions and 4 deletions
|
@ -203,6 +203,7 @@ This theme defines the following partials :
|
||||||
- `custom-header.html`: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file.
|
- `custom-header.html`: custom headers in page. Meant to be overwritten when adding CSS imports. Don't forget to include `style` HTML tag directive in your file.
|
||||||
- `custom-footer.html`: custom footer in page. Meant to be overwritten when adding JavaScript. Don't forget to include `javascript` HTML tag directive in your file.
|
- `custom-footer.html`: custom footer in page. Meant to be overwritten when adding JavaScript. Don't forget to include `javascript` HTML tag directive in your file.
|
||||||
- `favicon.html`: the favicon
|
- `favicon.html`: the favicon
|
||||||
|
- `heading.html`: side-wide configuration to change the pages title headings.
|
||||||
- `heading-pre.html`: side-wide configuration to prepend to pages title headings. If you override this, it is your responsibility to take the page's `headingPre` setting into account.
|
- `heading-pre.html`: side-wide configuration to prepend to pages title headings. If you override this, it is your responsibility to take the page's `headingPre` setting into account.
|
||||||
- `heading-post.html`: side-wide configuration to append to pages title headings. If you override this, it is your responsibility to take the page's `headingPost` setting into account.
|
- `heading-post.html`: side-wide configuration to append to pages title headings. If you override this, it is your responsibility to take the page's `headingPost` setting into account.
|
||||||
- `logo.html`: the logo, on top left hand corner
|
- `logo.html`: the logo, on top left hand corner
|
||||||
|
|
|
@ -28,6 +28,8 @@ This document shows you what's new in the latest release and flags it with one o
|
||||||
|
|
||||||
The advanced functionality allows you to set an explicit name for a theme variant, set different colors (if you are using monochrome SVGs) or even different icons (handy if you want to adjust colors for PNGs, GIFs or JPGs) and now allows for multiple auto mode variants that adjust to the light/dark preference of your OS settings.
|
The advanced functionality allows you to set an explicit name for a theme variant, set different colors (if you are using monochrome SVGs) or even different icons (handy if you want to adjust colors for PNGs, GIFs or JPGs) and now allows for multiple auto mode variants that adjust to the light/dark preference of your OS settings.
|
||||||
|
|
||||||
|
- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} New partial for defining the heading. See [documentation](basics/customization#partials) for further reading.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5.23.0 (2023-11-03) {#5230}
|
## 5.23.0 (2023-11-03) {#5230}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{{- partial "content-header.html" . }}
|
{{- partial "content-header.html" . }}
|
||||||
</header>
|
</header>
|
||||||
{{ 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 id="{{ .Title | plainify | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
|
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||||
|
|
||||||
{{ $content | safeHTML }}
|
{{ $content | safeHTML }}
|
||||||
<footer class="footline">
|
<footer class="footline">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<header class="headline">
|
<header class="headline">
|
||||||
{{- partial "content-header.html" . }}
|
{{- partial "content-header.html" . }}
|
||||||
</header>
|
</header>
|
||||||
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | plainify | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
|
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||||
|
|
||||||
{{ $content | safeHTML }}
|
{{ $content | safeHTML }}
|
||||||
<footer class="footline">
|
<footer class="footline">
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<header class="headline">
|
<header class="headline">
|
||||||
{{- partial "content-header.html" . }}
|
{{- partial "content-header.html" . }}
|
||||||
</header>
|
</header>
|
||||||
{{ partial "heading-pre.html" . }}<h1 id="{{ .Title | plainify | anchorize }}">{{ .Title }}</h1>{{ partial "heading-post.html" . }}
|
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}
|
||||||
|
|
||||||
{{ $content | safeHTML }}
|
{{ $content | safeHTML }}
|
||||||
<footer class="footline">
|
<footer class="footline">
|
||||||
|
|
1
layouts/partials/heading.html
Normal file
1
layouts/partials/heading.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{{ if not .IsHome }}<h1 id="{{ .Title | plainify | anchorize }}">{{ .Title }}</h1>{{ end }}
|
|
@ -1,6 +1,6 @@
|
||||||
{{- if not .Title }}
|
{{- if not .Title }}
|
||||||
{{- $title := .Site.Title }}
|
{{- $title := .Site.Title }}
|
||||||
{{- partial "heading-pre.html" . }}<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>{{ partial "heading-post.html" . }}
|
<h1 id="{{ $title | plainify | anchorize }}">{{ $title }}</h1>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- "layouts/partials/initial.md" | readFile | .RenderString }}
|
{{- "layouts/partials/initial.md" | readFile | .RenderString }}
|
Loading…
Reference in a new issue