From e6db609303aa258c450a2ebc453278b071bccb0e Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Tue, 24 Aug 2021 20:06:02 +0200 Subject: [PATCH] Use baseof for common base HTML --- layouts/_default/baseof.html | 10 ++++++++++ layouts/_default/list.html | 10 ++-------- layouts/_default/single.html | 10 ++-------- layouts/partials/title-item.html | 5 +++++ 4 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/partials/title-item.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..ee21374 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,10 @@ + + + + + {{ partial "title-item.html" . }}{{ .Site.Title }} + + + {{ block "main" . }}{{ end }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 72d531c..594f163 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,9 +1,4 @@ - - - - {{.Title}} - - +{{ define "main" }} {{ partial "content.html" . }} @@ -20,5 +15,4 @@ {{ partial "list_item.html" . }} {{ end }} {{ end }} - - +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7241808..d2ab006 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,9 +1,3 @@ - - - - {{.Title}} - - +{{ define "main" }} {{ partial "content.html" . }} - - +{{ end }} diff --git a/layouts/partials/title-item.html b/layouts/partials/title-item.html new file mode 100644 index 0000000..fef1c05 --- /dev/null +++ b/layouts/partials/title-item.html @@ -0,0 +1,5 @@ +{{ .Title }} :: + +{{ if .Parent }}{{ if not .Parent.IsHome }} + {{ partial "title-item.html" .Parent }} +{{ end }}{{ end }}