From 321fe23ea824d143eb92bd88673acb0788f0df31 Mon Sep 17 00:00:00 2001 From: "Kevin C. Coram" Date: Wed, 20 Nov 2019 23:38:53 -0500 Subject: [PATCH] Move majority of semantic tags to baseof.html In order to improve the semantic layout of the page(s) in the site, the bulk of the semantic elements have been explicitly moved to the baseof file. Additional Hugo blocks have been defined to allow layouts to supply or override things like section menus, the site menu, etc. --- layouts/_default/baseof.html | 46 ++++++++++++++++++++++++--------- layouts/_default/list.html | 24 +++++++---------- layouts/_default/single.html | 10 ++++--- layouts/_default/summary.html | 10 ++++--- layouts/index.html | 40 ++++++++++++++-------------- layouts/partials/footer.html | 8 +++--- layouts/partials/header.html | 31 ---------------------- layouts/partials/site-menu.html | 27 +++++++++++++++++++ 8 files changed, 105 insertions(+), 91 deletions(-) create mode 100644 layouts/partials/site-menu.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index df03897..f9c2d3f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,22 +4,44 @@ - {{ block "title" . }} + <title>{{- block "title" . -}} {{ .Site.Title }} - {{ end }} - + {{- end -}} - - {{ partial "header.html" . }} - {{ block "main" . }} - - {{ end }} - {{ block "footer" . }} - - {{ partial "footer.html" . }} - {{ end }} +
+ {{- block "site-header" . -}} + + {{ partial "header.html" . }} + {{- end }} + +
+
+
+ {{- block "content-header" . -}} + {{- end -}} + +
+
+ {{- block "content" . -}} + + {{ end }} +
+
+ \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3cde47c..3896140 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -2,18 +2,14 @@ {{ define "title" }} {{ .Title }} – {{ .Site.Title }} {{ end }} -{{ define "main" }} -
-
-

{{ .Title }}

-
- {{ .Content }} -
-
- {{ range .Pages }} - {{ .Render "summary"}} - {{ end }} -
-
-
+{{ define "content-header" }} +

{{ .Title }}

{{ end }} +{{ define "content" }} +
+ {{ .Content }} +
+{{ range .Pages }} +{{ .Render "summary"}} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 519c4b2..a3fd5ae 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,9 +2,11 @@ {{ define "title" }} {{ .Title }} – {{ .Site.Title }} {{ end }} -{{ define "main" }} -
-

{{ .Title }}

+{{ define "content-header" }} +

{{ .Title }}

+{{ end }} +{{ define "content" }} +
{{ .Content }} -
+ {{ end }} \ No newline at end of file diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index bb95004..e83980c 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -3,12 +3,14 @@

{{ .Title }}

{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words
- {{ .Summary }} - {{ if .Truncated }} +
+ {{ .Summary }} +
+ {{- if .Truncated }} - {{ end }} - + {{- end }} + \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index af1809f..c7eb2a4 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,22 +1,20 @@ -{{ define "main" }} -
-
-

{{.Title}}

- {{ if .Params.Subtitle }} - {{.Params.Subtitle}} - {{ else if .Site.Params.Subtitle }} - {{.Site.Params.Subtitle}} - {{ end }} -
-
- - {{.Content}} -
-
- - {{ range first 10 .Pages }} - {{ .Render "summary"}} - {{ end }} -
-
+{{- define "content-header" -}} +
+

{{.Title}}

+ {{- if .Params.Subtitle }} +

{{.Params.Subtitle}}

+ {{- else if .Site.Params.Subtitle }} +

{{.Site.Params.Subtitle}}

+ {{- end }} +
{{ end }} +{{ define "content" }} +
+ + {{.Content}} +
+ +{{ range first 10 .Pages }} +{{ .Render "summary"}} +{{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8b437a7..3e80538 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,5 +1,3 @@ - \ No newline at end of file +{{ with .Site.Copyright }} + +{{ end }} \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b1c0e96..e69de29 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,31 +0,0 @@ -
- -
\ No newline at end of file diff --git a/layouts/partials/site-menu.html b/layouts/partials/site-menu.html new file mode 100644 index 0000000..9a5d9b3 --- /dev/null +++ b/layouts/partials/site-menu.html @@ -0,0 +1,27 @@ + \ No newline at end of file