From f9436cd426a04460bdae430956e7be8e9ff82458 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 28 Nov 2024 23:02:16 +0800 Subject: refactor(head): tidy head partial --- themes/yinyang/layouts/partials/head.html | 59 ++-------------------- themes/yinyang/layouts/partials/head/css.html | 22 ++++++++ themes/yinyang/layouts/partials/head/seo.html | 29 +++++++++++ themes/yinyang/layouts/partials/head/siteinfo.html | 35 +++++++++++++ themes/yinyang/layouts/partials/seo.html | 29 ----------- 5 files changed, 91 insertions(+), 83 deletions(-) create mode 100644 themes/yinyang/layouts/partials/head/css.html create mode 100644 themes/yinyang/layouts/partials/head/seo.html create mode 100644 themes/yinyang/layouts/partials/head/siteinfo.html delete mode 100644 themes/yinyang/layouts/partials/seo.html diff --git a/themes/yinyang/layouts/partials/head.html b/themes/yinyang/layouts/partials/head.html index 436ae93f..f51ed656 100644 --- a/themes/yinyang/layouts/partials/head.html +++ b/themes/yinyang/layouts/partials/head.html @@ -8,38 +8,9 @@ - {{- if .Site.Params.staticPrefix -}} - - {{- end -}} - - {{- if .Site.Params.favicon -}} - - - - {{- end -}} - - - {{ partial "seo" . }} - - {{- if .IsHome -}} - {{ .Site.Title }} - - - - - {{- else -}} - {{ .Title }} - - - - - {{- end }} - - {{- if .Params.album -}} - - {{- else -}} - - {{ end }} + + {{ partial "head/seo" . }} + {{ partial "head/siteinfo" . }} {{ with resources.Get "css/index.css" | minify }} @@ -48,27 +19,7 @@ {{ with resources.Get "css/flexboxgrid-6.3.1.min.css" | minify }} {{ end }} - - - - - - - - - {{ range .Site.Params.extraCSSFiles -}} - - {{- end }} - - - {{ if .Site.Params.TwitterCards }}{{ template "_internal/twitter_cards.html" . }}{{ end }} + {{ .Site.Params.extraHead | safeHTML }} - + \ No newline at end of file diff --git a/themes/yinyang/layouts/partials/head/css.html b/themes/yinyang/layouts/partials/head/css.html new file mode 100644 index 00000000..3dbc6427 --- /dev/null +++ b/themes/yinyang/layouts/partials/head/css.html @@ -0,0 +1,22 @@ + +{{- if .Site.Params.staticPrefix -}} + +{{- end -}} + + + + + + + + + +{{ range .Site.Params.extraCSSFiles -}} + +{{- end }} \ No newline at end of file diff --git a/themes/yinyang/layouts/partials/head/seo.html b/themes/yinyang/layouts/partials/head/seo.html new file mode 100644 index 00000000..2d772d72 --- /dev/null +++ b/themes/yinyang/layouts/partials/head/seo.html @@ -0,0 +1,29 @@ + diff --git a/themes/yinyang/layouts/partials/head/siteinfo.html b/themes/yinyang/layouts/partials/head/siteinfo.html new file mode 100644 index 00000000..90cd8214 --- /dev/null +++ b/themes/yinyang/layouts/partials/head/siteinfo.html @@ -0,0 +1,35 @@ + +{{- if .IsHome -}} +{{ .Site.Title }} + + + + +{{- else -}} +{{ .Title }} + + + + +{{- end }} + +{{- if .Params.album -}} + +{{- else -}} + +{{ end }} + + +{{- if .Site.Params.favicon -}} + + + +{{- end -}} + + + + + + +{{ if .Site.Params.TwitterCards }}{{ template "_internal/twitter_cards.html" . }}{{ end }} \ No newline at end of file diff --git a/themes/yinyang/layouts/partials/seo.html b/themes/yinyang/layouts/partials/seo.html deleted file mode 100644 index 7cfe93c9..00000000 --- a/themes/yinyang/layouts/partials/seo.html +++ /dev/null @@ -1,29 +0,0 @@ - -- cgit v1.2.3