diff options
author | Francesco Tomaselli <tomaselli.fr@gmail.com> | 2025-04-29 22:15:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-29 22:15:58 +0200 |
commit | 3024ed2b94f7fe4cbb061eda68228e7a617b8add (patch) | |
tree | 50ad6cdab28e32e6f218b1e64a1fa2b426ce215f | |
parent | 968e55b308755f6be652a401e0d7d1bc3b17c127 (diff) | |
parent | e1598038023797808c53b84649a1d5ef36b1f800 (diff) |
Merge pull request #131 from runofthemillgeek/refactor/content-inside-article-header-tags
Move primary content inside an <article> tag
-rw-r--r-- | layouts/_default/single.html | 127 |
1 files changed, 63 insertions, 64 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 6869a46..209524e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,70 +7,69 @@ {{ end }} <div {{ if .Param "autonumber" }} class="autonumber" {{ end }}> - - <div class="single-intro-container"> - - {{/* Title and Summary */}} - - <h1 class="single-title">{{ .Title }}</h1> - {{ with .Param "summary" }} - <p class="single-summary">{{ . | markdownify }}</p> - {{ end }} - - {{/* Reading Time */}} - - <p class="single-readtime"> - {{ with .Date }} - {{ $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }} - {{ $dateHuman := . | time.Format (default ":date_long" $.Site.Params.singleDateFormat) }} - <time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> - {{end}} - - {{ if .Param "readTime" }} - · - {{ .ReadingTime }} min read - {{end }} - </p> - - </div> - - {{ if .Param "showTags" }} - - {{ $taxonomy := "tags" }} - {{ with .Param $taxonomy }} - - <div class="single-tags"> - {{ range $index, $tag := . }} - {{ with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} - <span> - <a href="{{ .Permalink }}">#{{ .LinkTitle }}</a> - </span> - {{ end }} - {{ end }} - </div> - - {{ end }} - {{ end }} - - {{/* Table of Content */}} - - {{ if .Param "toc" }} - <aside class="toc"> - <p><strong>Table of contents</strong></p> - {{ .TableOfContents }} - </aside> - {{ end }} - - {{/* Page content */}} - - <div class="single-content"> - {{ .Content }} - {{ if .Site.Params.giscus.enable }} - {{ if not .Params.disableComment }} - {{ partial "comments.html" . }} - {{ end }} - {{ end }} - </div> + <article> + <header class="single-intro-container"> + {{- /* Title and Summary */}} + + <h1 class="single-title">{{ .Title }}</h1> + {{- with .Param "summary" }} + <p class="single-summary">{{ . | markdownify }}</p> + {{- end }} + + {{- /* Reading Time */}} + + <p class="single-readtime"> + {{- with .Date }} + {{- $dateMachine := . | time.Format "2006-01-02T15:04:05-07:00" }} + {{- $dateHuman := . | time.Format (default ":date_long" $.Site.Params.singleDateFormat) }} + <time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time> + {{- end }} + + {{- if .Param "readTime" }} + · + {{- .ReadingTime }} min read + {{- end }} + </p> + </header> + + {{- if .Param "showTags" }} + {{- $taxonomy := "tags" }} + {{- with .Param $taxonomy }} + <div class="single-tags"> + {{- range $index, $tag := . }} + {{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}} + <span> + <a href="{{ .Permalink }}">#{{ .LinkTitle }}</a> + </span> + {{- end }} + {{- end }} + </div> + {{- end }} + {{- end }} + + {{- /* Table of Contents */}} + + {{- if .Param "toc" }} + <aside class="toc"> + <p><strong>Table of contents</strong></p> + {{ .TableOfContents }} + </aside> + {{- end }} + + {{- /* Page content */}} + + <div class="single-content"> + {{ .Content }} + </div> + </article> + + {{- /* Comments */}} + + {{- if and .Site.Params.giscus.enable (not .Params.disableComment) }} + <div class="single-comments"> + {{ partial "comments.html" . }} + </div> + {{- end }} {{ if .Store.Get "hasMermaid" }} {{ $mermaidDarkTheme := default "dark" (or .Params.mermaidDarkTheme .Site.Params.mermaidDarkTheme) }} |