From 59c7d4567380d1a9c80e96eb958fdbdd512ce006 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Sun, 3 Nov 2024 20:08:36 +0300 Subject: новая жизнь блога MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/partials/head/colorScheme.html | 39 ++++++++++++++++++++ .../layouts/partials/head/custom.html | 0 .../layouts/partials/head/head.html | 26 +++++++++++++ .../layouts/partials/head/opengraph/include.html | 2 + .../partials/head/opengraph/provider/base.html | 43 ++++++++++++++++++++++ .../partials/head/opengraph/provider/twitter.html | 16 ++++++++ .../layouts/partials/head/script.html | 0 .../layouts/partials/head/style.html | 3 ++ 8 files changed, 129 insertions(+) create mode 100644 themes/hugo-theme-stack/layouts/partials/head/colorScheme.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/custom.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/head.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/opengraph/include.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/twitter.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/script.html create mode 100644 themes/hugo-theme-stack/layouts/partials/head/style.html (limited to 'themes/hugo-theme-stack/layouts/partials/head') diff --git a/themes/hugo-theme-stack/layouts/partials/head/colorScheme.html b/themes/hugo-theme-stack/layouts/partials/head/colorScheme.html new file mode 100644 index 0000000..42f4dd8 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/colorScheme.html @@ -0,0 +1,39 @@ +{{- $defaultColorScheme := default "auto" .Site.Params.colorScheme.default -}} +{{- if not (default false .Site.Params.colorScheme.toggle) -}} + {{/* If toggle is disabled, force default scheme */}} + +{{- else -}} + {{/* Otherwise set to default scheme only if no preference is set by user */}} + +{{- end -}} + + diff --git a/themes/hugo-theme-stack/layouts/partials/head/custom.html b/themes/hugo-theme-stack/layouts/partials/head/custom.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-theme-stack/layouts/partials/head/head.html b/themes/hugo-theme-stack/layouts/partials/head/head.html new file mode 100644 index 0000000..a7991c1 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/head.html @@ -0,0 +1,26 @@ + + + +{{- $description := partialCached "data/description" . .RelPermalink -}} + +{{ with .Params.Keywords }}{{ end }} + +{{- $title := partial "data/title" . -}} +{{ $title }} + + + +{{- partial "head/style.html" . -}} +{{- partial "head/script.html" . -}} +{{- partial "head/opengraph/include.html" . -}} + +{{- range .AlternativeOutputFormats -}} + +{{- end -}} + +{{ with .Site.Params.favicon }} + +{{ end }} + +{{- template "_internal/google_analytics.html" . -}} +{{- partial "head/custom.html" . -}} diff --git a/themes/hugo-theme-stack/layouts/partials/head/opengraph/include.html b/themes/hugo-theme-stack/layouts/partials/head/opengraph/include.html new file mode 100644 index 0000000..3a43f48 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/opengraph/include.html @@ -0,0 +1,2 @@ +{{ partial "head/opengraph/provider/base" . }} +{{ partial "head/opengraph/provider/twitter" . }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html b/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html new file mode 100644 index 0000000..055745d --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/base.html @@ -0,0 +1,43 @@ +{{- $title := partialCached "data/title" . .RelPermalink -}} +{{- $description := partialCached "data/description" . .RelPermalink -}} + + + + + + + +{{- with .Params.locale -}} + +{{- end -}} + +{{- if .IsPage -}} + + {{- range .Params.tags -}} + + {{- end -}} +{{- end -}} + +{{- if .IsPage -}} + {{- if not .Date.IsZero -}} + + {{- end -}} + {{- if not .Lastmod.IsZero -}} + + {{- end -}} +{{- else -}} + {{- if not .Site.Lastmod.IsZero -}} + + {{- end -}} +{{- end -}} + +{{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }} +{{- if $image.exists -}} + +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/twitter.html b/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/twitter.html new file mode 100644 index 0000000..c39eba3 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/opengraph/provider/twitter.html @@ -0,0 +1,16 @@ +{{- with .Site.Params.opengraph.twitter.site -}} + + +{{- end -}} + +{{- $title := partialCached "data/title" . .RelPermalink -}} +{{- $description := partialCached "data/description" . .RelPermalink -}} + + + + +{{- $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" -}} +{{- if $image.exists -}} + + +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/head/script.html b/themes/hugo-theme-stack/layouts/partials/head/script.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-theme-stack/layouts/partials/head/style.html b/themes/hugo-theme-stack/layouts/partials/head/style.html new file mode 100644 index 0000000..30ca26e --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/head/style.html @@ -0,0 +1,3 @@ +{{ $sass := resources.Get "scss/style.scss" }} +{{ $style := $sass | toCSS | minify | resources.Fingerprint "sha256" }} + \ No newline at end of file -- cgit v1.2.3