From 75a45a192bebb68978b438eb6623e242471b50ec Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 11 May 2022 14:10:49 +0200 Subject: [PATCH] Format HTML everywhere --- layouts/_default/_markup/render-heading.html | 4 +- layouts/_default/_markup/render-image.html | 11 +-- layouts/_default/baseof.html | 11 ++- layouts/_default/gandalf_forbid.html | 84 ++++++++------------ layouts/_default/single.html | 8 +- layouts/_default/terms.html | 24 +++--- layouts/index.html | 8 +- layouts/partials/content-details.html | 26 +++--- layouts/partials/content.html | 60 +++++++------- layouts/partials/favicon.html | 4 +- layouts/partials/footer.html | 37 ++++----- layouts/partials/header_image.html | 14 ++-- layouts/partials/navbar.html | 50 ++++++------ layouts/partials/script.html | 4 +- layouts/partials/script_async.html | 4 +- layouts/partials/summary.html | 4 +- layouts/partials/title-item.html | 2 +- layouts/shortcodes/youtube.html | 8 +- 18 files changed, 174 insertions(+), 189 deletions(-) diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 4eb0cf4..9f37d0c 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1 +1,3 @@ - # {{ .Text | safeHTML}} + + # {{ .Text | safeHTML}} + diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 1ee9df7..e35872c 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -3,12 +3,13 @@ {{ $resource := .Page.Resources.GetMatch $destination }} {{ if $resource }} - {{ $destination = ($resource.Resize "1500x webp").RelPermalink }} +{{ $destination = ($resource.Resize "1500x webp").RelPermalink }} {{ end }}
- {{ .Text | plainify }} -
- {{ .Text }} -
+ {{ .Text | plainify }} +
+ {{ .Text }} +
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index def564b..73c6599 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,6 +1,7 @@ - + + {{ partial "style.html" "scss/style.scss" }} @@ -12,8 +13,9 @@ {{ partial "title-item.html" . }}{{ .Site.Title }} {{ block "head_extra" . }}{{ end }} - - + + + {{ partial "navbar.html" . }} {{ block "main" . }}{{ end }} {{ partial "footer.html" . }} @@ -21,5 +23,6 @@ {{ partial "script.html" "js/jquery.min.js" }} {{ partial "script_async.html" "js/bootstrap.min.js" }} {{ block "scripts_extra" . }}{{ end }} - + + diff --git a/layouts/_default/gandalf_forbid.html b/layouts/_default/gandalf_forbid.html index 7c867ae..7e49e6e 100644 --- a/layouts/_default/gandalf_forbid.html +++ b/layouts/_default/gandalf_forbid.html @@ -1,48 +1,40 @@ {{ define "head_extra" }} - {{ partial "style.html" "scss/forbid_style.scss" }} +{{ partial "style.html" "scss/forbid_style.scss" }} {{ end }} {{ define "main" }} -
+

{{ .Title }}

{{ .Content }}

- + - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - -
+
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 0c5fa3c..a56559d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,8 +1,8 @@ {{ define "main" }} -
+
- {{ partial "header_image.html" . }} - {{ partial "content.html" . }} + {{ partial "header_image.html" . }} + {{ partial "content.html" . }}
-
+
{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 8cdf994..20ae850 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,19 +1,19 @@ {{ define "main" }} -
+
- {{ partial "content.html" . }} - {{ if .Content }} + {{ partial "content.html" . }} + {{ if .Content }}
- {{ end }} - {{ range .Pages.ByTitle }} + {{ end }} + {{ range .Pages.ByTitle }} - {{ end }} + {{ end }}
-
+
{{ end }} diff --git a/layouts/index.html b/layouts/index.html index fb1f465..9dd77bb 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,8 +1,8 @@ {{ define "main" }} -
+
- {{ partial "header_image.html" . }} - {{ .Content }} + {{ partial "header_image.html" . }} + {{ .Content }}
-
+
{{ end }} diff --git a/layouts/partials/content-details.html b/layouts/partials/content-details.html index 3c34f40..3f6c407 100644 --- a/layouts/partials/content-details.html +++ b/layouts/partials/content-details.html @@ -5,21 +5,23 @@ {{ end }} {{ if not .Parent.IsHome }} - {{ if gt .ReadingTime 2 }} - - {{ .ReadingTime }} minutes - - {{ end }} - +{{ if gt .ReadingTime 2 }} + + {{ .ReadingTime }} minutes + +{{ end }} + {{ .WordCount }} words - + {{ end }} {{ if .Params.tags }} - - - - {{ range $i, $e := .Params.tags }} + + + + + {{ range $i, $e := .Params.tags }} #{{ . }} - {{ end }} + {{ end }} + {{ end }} diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 324135c..6982f05 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -1,45 +1,45 @@

{{ .Title }}

{{ if .Params.subtitle }} -
{{ markdownify .Params.subtitle | emojify }}
+
{{ markdownify .Params.subtitle | emojify }}
{{ end }} {{ if .IsPage }} -

{{ partial "content-details.html" . }}

+

{{ partial "content-details.html" . }}

- - {{ if and (not .Lastmod.IsZero) (not (.Lastmod.Equal .Date)) }} - - Article revised in: {{ .Lastmod.Format "January 2 2006" }} - - {{ end }} + +{{ if and (not .Lastmod.IsZero) (not (.Lastmod.Equal .Date)) }} + + Article revised in: {{ .Lastmod.Format "January 2 2006" }} + +{{ end }} {{ end }} {{ if .Content }} -
+
-
+
{{ if .TableOfContents }} - - {{ $headers := findRE "(.|\n])+?" .Content }} - - {{ if ge (len $headers) 4 }} + + {{ $headers := findRE "(.|\n])+?" .Content }} + + {{ if ge (len $headers) 4 }}
- {{ .TableOfContents }} + {{ .TableOfContents }}
- {{ end }} - {{ end }} - {{ .Content }} - - -
- {{ if .Params.Sources }} -

Sources

-
    - {{ range $i, $e := .Params.Sources }} -
  • {{ markdownify $e }}
  • {{ end }} -
- {{ end }} -
-
+ {{ end }} + {{ .Content }} + + +
+ {{ if .Params.Sources }} +

Sources

+
    + {{ range $i, $e := .Params.Sources }} +
  • {{ markdownify $e }}
  • + {{ end }} +
+ {{ end }} +
+
{{ end }} diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html index 401fa74..d7d9d21 100644 --- a/layouts/partials/favicon.html +++ b/layouts/partials/favicon.html @@ -2,7 +2,7 @@ {{ $sizes := slice 16 32 64 100 200 }} {{ range $sizes }} - {{ $sizes := printf "%dx%d" . . }} - {{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 02f3d58..2114417 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,21 +1,22 @@ diff --git a/layouts/partials/header_image.html b/layouts/partials/header_image.html index 9657cc2..3c4aa46 100644 --- a/layouts/partials/header_image.html +++ b/layouts/partials/header_image.html @@ -1,9 +1,9 @@ {{ if .Params.image }} - {{ .Scratch.Set "image" .Params.image }} - {{ if hasPrefix .Params.image "resource:" }} - {{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }} - {{ .Scratch.Set "image" ($resource.Resize "2000x").RelPermalink }} - {{ end }} - - +{{ .Scratch.Set "image" .Params.image }} +{{ if hasPrefix .Params.image "resource:" }} +{{ $resource := .Resources.GetMatch (replace .Params.image "resource:" "") }} +{{ .Scratch.Set "image" ($resource.Resize "2000x").RelPermalink }} +{{ end }} + + {{ end }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index dbc0fab..e052744 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1,31 +1,31 @@ diff --git a/layouts/partials/script.html b/layouts/partials/script.html index 2c298a5..0fa1e1a 100644 --- a/layouts/partials/script.html +++ b/layouts/partials/script.html @@ -1,9 +1,9 @@ {{ $script := resources.Get . }} {{ if in . "min" }} - {{ $script = $script | minify | fingerprint }} +{{ $script = $script | minify | fingerprint }} {{ else }} - {{ $script = $script | js.Build (dict "minify" true) | fingerprint }} +{{ $script = $script | js.Build (dict "minify" true) | fingerprint }} {{ end }} diff --git a/layouts/partials/script_async.html b/layouts/partials/script_async.html index 16aded7..f5d22f0 100644 --- a/layouts/partials/script_async.html +++ b/layouts/partials/script_async.html @@ -1,9 +1,9 @@ {{ $script := resources.Get . }} {{ if in . "min" }} - {{ $script = $script | minify | fingerprint }} +{{ $script = $script | minify | fingerprint }} {{ else }} - {{ $script = $script | js.Build (dict "minify" true) | fingerprint }} +{{ $script = $script | js.Build (dict "minify" true) | fingerprint }} {{ end }} diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html index 023514f..a6ed3ce 100644 --- a/layouts/partials/summary.html +++ b/layouts/partials/summary.html @@ -1,5 +1,5 @@ {{ if .Content }} - {{ .Summary | chomp }}{{ if .Truncated }}…{{ end }} +{{ .Summary | chomp }}{{ if .Truncated }}…{{ end }} {{ else if .Params.subtitle }} - {{ .Params.subtitle | markdownify | emojify }} +{{ .Params.subtitle | markdownify | emojify }} {{ end }} diff --git a/layouts/partials/title-item.html b/layouts/partials/title-item.html index ff04ab0..1b89ea0 100644 --- a/layouts/partials/title-item.html +++ b/layouts/partials/title-item.html @@ -1,5 +1,5 @@ {{ .Title }} :: {{ if .Parent }}{{ if not .Parent.IsHome }} - {{ partial "title-item.html" .Parent }} +{{ partial "title-item.html" .Parent }} {{ end }}{{ end }} diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html index 1dc78db..f2783de 100644 --- a/layouts/shortcodes/youtube.html +++ b/layouts/shortcodes/youtube.html @@ -1,7 +1,3 @@ - + allowfullscreen>