Skip to content

Commit c4a6c25

Browse files
authored
Merge pull request #1672 from gethinode/templatev2
refactor: enhance minimal header with configurable styling
2 parents b51ba24 + 07e303a commit c4a6c25

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

layouts/minimal/header.html

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
{{/* Initialize global variables */}}
2-
{{- $sharing := $.Scratch.Get "sharing" -}}
2+
{{- $size := .Site.Params.style.title.size | default 4 -}}
3+
{{- $headingStyle := .Site.Params.style.title.headingStyle | default "display" -}}
4+
{{- $contentStyle := .Site.Params.style.title.contentStyle | default "lead text-muted" -}}
5+
{{- $padding := partial "utilities/GetPadding.html" -}}
36

7+
{{/* Initialize local variables */}}
8+
{{- $breakpoint := .Scratch.Get "breakpoint" -}}
49
{{ $title := .Title }}
5-
{{ if and site.Params.main.titleCase (not .Page.Params.exact) }}{{ $title = title $title }}{{ end }}
10+
{{ if and .Site.Params.main.titleCase (not .Params.exact) }}{{ $title = title $title }}{{ end }}
611

7-
{{ with $title }}<p class="display-4 mt-5">{{ . }}</p>{{ end }}
8-
{{- if $sharing }}
9-
<div class="py-3 d-flex align-items-center"><span class="me-1">{{ T "shareLink" " " }}</span>{{ partial "page/sharing.html" . }}</div>
10-
{{ end -}}
11-
<p class="lead mb-5">{{ .Description }}</p>
12+
{{/* Display title */}}
13+
{{ with $title }}<h1 id="{{ anchorize . }}" class="{{ $headingStyle }}-{{ $size }} pt-1">{{ . }}</h1>{{ end }}
14+
15+
{{/* Display description */}}
16+
{{ with .Description }}
17+
<div class="{{ $contentStyle }} py-{{ $padding.y }}">{{ . | $.RenderString | safeHTML }}</div>
18+
{{ end }}

0 commit comments

Comments
 (0)