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/article-list/compact.html | 40 ++++++++ .../layouts/partials/article-list/default.html | 4 + .../layouts/partials/article-list/tile.html | 39 ++++++++ .../layouts/partials/article/article.html | 11 +++ .../partials/article/components/content.html | 5 + .../partials/article/components/details.html | 61 ++++++++++++ .../partials/article/components/footer.html | 19 ++++ .../partials/article/components/header.html | 35 +++++++ .../layouts/partials/article/components/links.html | 30 ++++++ .../layouts/partials/article/components/math.html | 13 +++ .../partials/article/components/photoswipe.html | 68 ++++++++++++++ .../article/components/related-content.html | 13 +++ .../layouts/partials/article/components/tags.html | 7 ++ .../layouts/partials/comments/include.html | 3 + .../partials/comments/provider/beaudar.html | 46 +++++++++ .../layouts/partials/comments/provider/cactus.html | 29 ++++++ .../layouts/partials/comments/provider/cusdis.html | 21 +++++ .../layouts/partials/comments/provider/disqus.html | 22 +++++ .../partials/comments/provider/disqusjs.html | 61 ++++++++++++ .../layouts/partials/comments/provider/giscus.html | 52 +++++++++++ .../layouts/partials/comments/provider/gitalk.html | 31 +++++++ .../partials/comments/provider/remark42.html | 29 ++++++ .../layouts/partials/comments/provider/twikoo.html | 58 ++++++++++++ .../partials/comments/provider/utterances.html | 46 +++++++++ .../layouts/partials/comments/provider/vssue.html | 27 ++++++ .../layouts/partials/comments/provider/waline.html | 34 +++++++ .../layouts/partials/data/description.html | 17 ++++ .../layouts/partials/data/title.html | 38 ++++++++ .../partials/footer/components/custom-font.html | 11 +++ .../layouts/partials/footer/components/script.html | 12 +++ .../layouts/partials/footer/custom.html | 0 .../layouts/partials/footer/footer.html | 23 +++++ .../layouts/partials/footer/include.html | 3 + .../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 + .../layouts/partials/helper/external.html | 29 ++++++ .../layouts/partials/helper/icon.html | 6 ++ .../layouts/partials/helper/image.html | 61 ++++++++++++ .../layouts/partials/pagination.html | 26 ++++++ .../layouts/partials/sidebar/left.html | 103 +++++++++++++++++++++ .../layouts/partials/sidebar/right.html | 16 ++++ .../layouts/partials/widget/archives.html | 35 +++++++ .../layouts/partials/widget/categories.html | 16 ++++ .../layouts/partials/widget/search.html | 16 ++++ .../layouts/partials/widget/tag-cloud.html | 16 ++++ .../layouts/partials/widget/toc.html | 12 +++ 52 files changed, 1373 insertions(+) create mode 100644 themes/hugo-theme-stack/layouts/partials/article-list/compact.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article-list/default.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article-list/tile.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/article.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/content.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/details.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/footer.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/header.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/links.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/math.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/photoswipe.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/related-content.html create mode 100644 themes/hugo-theme-stack/layouts/partials/article/components/tags.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/include.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/cactus.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/gitalk.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/twikoo.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/vssue.html create mode 100644 themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html create mode 100644 themes/hugo-theme-stack/layouts/partials/data/description.html create mode 100644 themes/hugo-theme-stack/layouts/partials/data/title.html create mode 100644 themes/hugo-theme-stack/layouts/partials/footer/components/custom-font.html create mode 100644 themes/hugo-theme-stack/layouts/partials/footer/components/script.html create mode 100644 themes/hugo-theme-stack/layouts/partials/footer/custom.html create mode 100644 themes/hugo-theme-stack/layouts/partials/footer/footer.html create mode 100644 themes/hugo-theme-stack/layouts/partials/footer/include.html 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 create mode 100644 themes/hugo-theme-stack/layouts/partials/helper/external.html create mode 100644 themes/hugo-theme-stack/layouts/partials/helper/icon.html create mode 100644 themes/hugo-theme-stack/layouts/partials/helper/image.html create mode 100644 themes/hugo-theme-stack/layouts/partials/pagination.html create mode 100644 themes/hugo-theme-stack/layouts/partials/sidebar/left.html create mode 100644 themes/hugo-theme-stack/layouts/partials/sidebar/right.html create mode 100644 themes/hugo-theme-stack/layouts/partials/widget/archives.html create mode 100644 themes/hugo-theme-stack/layouts/partials/widget/categories.html create mode 100644 themes/hugo-theme-stack/layouts/partials/widget/search.html create mode 100644 themes/hugo-theme-stack/layouts/partials/widget/tag-cloud.html create mode 100644 themes/hugo-theme-stack/layouts/partials/widget/toc.html (limited to 'themes/hugo-theme-stack/layouts/partials') diff --git a/themes/hugo-theme-stack/layouts/partials/article-list/compact.html b/themes/hugo-theme-stack/layouts/partials/article-list/compact.html new file mode 100644 index 0000000..376512a --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article-list/compact.html @@ -0,0 +1,40 @@ +
+ +
+

+ {{- .Title -}} +

+
+ +
+
+ + {{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}} + {{ if $image.exists }} +
+ {{ if $image.resource }} + {{- $Permalink := $image.resource.RelPermalink -}} + {{- $Width := $image.resource.Width -}} + {{- $Height := $image.resource.Height -}} + + {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} + {{- $thumbnail := $image.resource.Fill "120x120" -}} + {{- $Permalink = $thumbnail.RelPermalink -}} + {{- $Width = $thumbnail.Width -}} + {{- $Height = $thumbnail.Height -}} + {{- end -}} + + {{ .Title }} + {{ else }} + Featured image of post {{ .Title }} + {{ end }} +
+ {{ end }} +
+
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article-list/default.html b/themes/hugo-theme-stack/layouts/partials/article-list/default.html new file mode 100644 index 0000000..02e0b30 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article-list/default.html @@ -0,0 +1,4 @@ +{{ $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" }} +
+ {{ partial "article/components/header" . }} +
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article-list/tile.html b/themes/hugo-theme-stack/layouts/partials/article-list/tile.html new file mode 100644 index 0000000..be5744b --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article-list/tile.html @@ -0,0 +1,39 @@ +{{ $image := partialCached "helper/image" (dict "Context" .context "Type" .Type) .context.RelPermalink .Type }} +
+ + + {{ if $image.exists }} +
+ {{ if $image.resource }} + {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}} + {{- $Permalink := $imageRaw.RelPermalink -}} + {{- $Width := $imageRaw.Width -}} + {{- $Height := $imageRaw.Height -}} + + {{- if .context.Site.Params.imageProcessing.cover.enabled -}} + {{- $thumbnail := $imageRaw.Fill .size -}} + {{- $Permalink = $thumbnail.RelPermalink -}} + {{- $Width = $thumbnail.Width -}} + {{- $Height = $thumbnail.Height -}} + {{- end -}} + + Featured image of post {{ .context.Title }} + {{ else }} + + {{ end }} +
+ {{ end }} + +
+

+ {{- .context.Title -}} +

+
+
+
diff --git a/themes/hugo-theme-stack/layouts/partials/article/article.html b/themes/hugo-theme-stack/layouts/partials/article/article.html new file mode 100644 index 0000000..f3f7e90 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/article.html @@ -0,0 +1,11 @@ +
+ {{ partial "article/components/header" . }} + + {{ partial "article/components/content" . }} + + {{ partial "article/components/footer" . }} + + {{ if or .Params.math .Site.Params.article.math }} + {{ partialCached "article/components/math.html" . }} + {{ end }} +
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/content.html b/themes/hugo-theme-stack/layouts/partials/article/components/content.html new file mode 100644 index 0000000..61e536c --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/content.html @@ -0,0 +1,5 @@ +
+ + {{ $wrappedTable := printf "
${1}
" }} + {{ .Content | replaceRE "((?:.|\n)+?
)" $wrappedTable | safeHTML }} +
diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/details.html b/themes/hugo-theme-stack/layouts/partials/article/components/details.html new file mode 100644 index 0000000..7c27302 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/details.html @@ -0,0 +1,61 @@ +
+ {{ if .Params.categories }} + + {{ end }} + +
+

+ + {{- .Title -}} + +

+ + {{ with .Params.description }} +

+ {{ . }} +

+ {{ end }} +
+ + {{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }} + {{ $showDate := not .Date.IsZero }} + {{ $showFooter := or $showDate $showReadingTime }} + {{ if $showFooter }} +
+ {{ if $showDate }} +
+ {{ partial "helper/icon" "date" }} + +
+ {{ end }} + + {{ if $showReadingTime }} +
+ {{ partial "helper/icon" "clock" }} + +
+ {{ end }} +
+ {{ end }} + + {{ if .IsTranslated }} + + {{ end }} +
diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/footer.html b/themes/hugo-theme-stack/layouts/partials/article/components/footer.html new file mode 100644 index 0000000..9795880 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/footer.html @@ -0,0 +1,19 @@ + diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/header.html b/themes/hugo-theme-stack/layouts/partials/article/components/header.html new file mode 100644 index 0000000..7582ec2 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/header.html @@ -0,0 +1,35 @@ +
+ {{- $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" -}} + {{ if $image.exists }} +
+ + {{ if $image.resource }} + {{- $Permalink := $image.resource.RelPermalink -}} + {{- $Width := $image.resource.Width -}} + {{- $Height := $image.resource.Height -}} + {{- $Srcset := "" -}} + + {{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}} + {{- $thumbnail := $image.resource.Resize "800x" -}} + {{- $thumbnailRetina := $image.resource.Resize "1600x" -}} + {{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}} + {{- $Permalink = $thumbnail.RelPermalink -}} + {{- $Width = $thumbnail.Width -}} + {{- $Height = $thumbnail.Height -}} + {{- end -}} + + Featured image of post {{ .Title }} + {{ else }} + Featured image of post {{ .Title }} + {{ end }} + +
+ {{ end }} + + {{ partialCached "article/components/details" . .RelPermalink }} +
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/links.html b/themes/hugo-theme-stack/layouts/partials/article/components/links.html new file mode 100644 index 0000000..a2ac26c --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/links.html @@ -0,0 +1,30 @@ +
+ {{ range $i, $link := .Params.links }} + + {{ end }} +
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/math.html b/themes/hugo-theme-stack/layouts/partials/article/components/math.html new file mode 100644 index 0000000..bd1a7f8 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/math.html @@ -0,0 +1,13 @@ +{{- partial "helper/external" (dict "Context" . "Namespace" "KaTeX") -}} + \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/photoswipe.html b/themes/hugo-theme-stack/layouts/partials/article/components/photoswipe.html new file mode 100644 index 0000000..c33ff49 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/photoswipe.html @@ -0,0 +1,68 @@ + + + +{{- partial "helper/external" (dict "Context" . "Namespace" "PhotoSwipe") -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/related-content.html b/themes/hugo-theme-stack/layouts/partials/article/components/related-content.html new file mode 100644 index 0000000..aba88e3 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/related-content.html @@ -0,0 +1,13 @@ +{{ $related := (where (.Site.RegularPages.Related .) "Params.hidden" "!=" true) | first 5 }} +{{ with $related }} + +{{ end }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/article/components/tags.html b/themes/hugo-theme-stack/layouts/partials/article/components/tags.html new file mode 100644 index 0000000..aae38b4 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/article/components/tags.html @@ -0,0 +1,7 @@ +{{ if .Params.Tags }} +
+ {{ range (.GetTerms "tags") }} + {{ .LinkTitle }} + {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/include.html b/themes/hugo-theme-stack/layouts/partials/comments/include.html new file mode 100644 index 0000000..a3d0618 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/include.html @@ -0,0 +1,3 @@ +{{ if .Site.Params.comments.enabled }} + {{ partial (printf "comments/provider/%s" .Site.Params.comments.provider) . }} +{{ end }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html new file mode 100644 index 0000000..761801f --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/beaudar.html @@ -0,0 +1,46 @@ + + + + + diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/cactus.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/cactus.html new file mode 100644 index 0000000..ae172d3 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/cactus.html @@ -0,0 +1,29 @@ +{{- with .Site.Params.comments.cactus -}} +{{- partial "helper/external" (dict "Context" $ "Namespace" "Cactus") -}} + + + +
+ + +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html new file mode 100644 index 0000000..a89746c --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/cusdis.html @@ -0,0 +1,21 @@ +{{- $host := default "https://cusdis.com" .Site.Params.comments.cusdis.host -}} +
+ + + diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html new file mode 100644 index 0000000..fb17b77 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqus.html @@ -0,0 +1,22 @@ +
+ {{ template "_internal/disqus.html" . }} +
+ + + + \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html new file mode 100644 index 0000000..967c38c --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/disqusjs.html @@ -0,0 +1,61 @@ +{{- $pc := .Site.Config.Privacy.Disqus -}} +{{- $disqusjs := .Site.Params.Comments.disqusjs -}} +{{- if and (not $pc.Disable) (and $disqusjs.Shortname $disqusjs.ApiKey) -}} + +{{- $style := resources.Get "scss/partials/comments/disqusjs.scss" | toCSS | minify -}} + + +
+
+ + +
+{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html new file mode 100644 index 0000000..97fbb77 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/giscus.html @@ -0,0 +1,52 @@ +{{- with .Site.Params.comments.giscus -}} + + +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/gitalk.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/gitalk.html new file mode 100644 index 0000000..54bfcba --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/gitalk.html @@ -0,0 +1,31 @@ +{{- with .Site.Params.comments.gitalk -}} +
+ + + + +{{ end }} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html new file mode 100644 index 0000000..18acf1b --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/remark42.html @@ -0,0 +1,29 @@ +{{- with .Site.Params.comments.remark42 -}} +
+ +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/twikoo.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/twikoo.html new file mode 100644 index 0000000..8c22507 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/twikoo.html @@ -0,0 +1,58 @@ + +
+ + +{{- with .Site.Params.comments.twikoo -}} + +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html new file mode 100644 index 0000000..b1e370b --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/utterances.html @@ -0,0 +1,46 @@ + + + + + diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/vssue.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/vssue.html new file mode 100644 index 0000000..79ac381 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/vssue.html @@ -0,0 +1,27 @@ +{{- with .Site.Params.comments.vssue -}} + + +
+ + + + + +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html b/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html new file mode 100644 index 0000000..9d1a2a0 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/comments/provider/waline.html @@ -0,0 +1,34 @@ + + +
+ + +{{- with .Site.Params.comments.waline -}} +{{- $config := dict "el" "#waline" "dark" `html[data-scheme="dark"]` -}} +{{- $replaceKeys := dict "serverurl" "serverURL" "requiredmeta" "requiredMeta" "wordlimit" "wordLimit" "pagesize" "pageSize" "imageuploader" "imageUploader" "texrenderer" "texRenderer" -}} + +{{- range $key, $val := . -}} + {{- if ne $val nil -}} + {{- $replaceKey := index $replaceKeys $key -}} + {{- $k := default $key $replaceKey -}} + + {{- $config = merge $config (dict $k $val) -}} + {{- end -}} +{{- end -}} + + +{{- end -}} diff --git a/themes/hugo-theme-stack/layouts/partials/data/description.html b/themes/hugo-theme-stack/layouts/partials/data/description.html new file mode 100644 index 0000000..7f6cc32 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/data/description.html @@ -0,0 +1,17 @@ + +{{ $description := .Site.Params.sidebar.subtitle }} + + +{{ if .Site.Params.description }} + {{ $description = .Site.Params.description }} +{{ end }} + +{{ if .Description }} + + {{ $description = .Description }} +{{ else if .IsPage }} + + {{ $description = .Summary }} +{{ end }} + +{{ return (replaceRE "\n" " " $description | plainify) }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/data/title.html b/themes/hugo-theme-stack/layouts/partials/data/title.html new file mode 100644 index 0000000..85a7bc7 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/data/title.html @@ -0,0 +1,38 @@ +{{- $title := .Title -}} +{{- $siteTitle := .Site.Title -}} + +{{- if .IsHome -}} + + + + {{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }} + {{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }} + {{ $filtered := ($pages | intersect $notHidden) }} + {{ $pag := .Paginate ($filtered) }} + + {{ if .Paginator.HasPrev }} + + {{ $title = printf "%s - %s" .Paginator $siteTitle }} + {{ else }} + {{ $title = $siteTitle}} + {{ end }} +{{- else if eq .Kind "term" -}} + + + + {{ $notHidden := where .Pages "Params.hidden" "!=" true }} + {{ $pag := .Paginate ($notHidden) }} + + + {{ $title = slice (title .Data.Singular) ": " $title }} + + {{ if .Paginator.HasPrev }} + + {{ $title = $title | append " - " .Paginator }} + {{ end }} + + {{ $title = $title | append " - " $siteTitle }} + {{ $title = delimit $title "" }} +{{- end -}} + +{{ return $title }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/footer/components/custom-font.html b/themes/hugo-theme-stack/layouts/partials/footer/components/custom-font.html new file mode 100644 index 0000000..8e2ff37 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/footer/components/custom-font.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/footer/components/script.html b/themes/hugo-theme-stack/layouts/partials/footer/components/script.html new file mode 100644 index 0000000..3dc96cb --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/footer/components/script.html @@ -0,0 +1,12 @@ +{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}} + +{{- $opts := dict "minify" hugo.IsProduction -}} +{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}} + + + +{{- with resources.Get "ts/custom.ts" -}} + {{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}} + {{- $customScript := . | js.Build $opts | fingerprint -}} + +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/footer/custom.html b/themes/hugo-theme-stack/layouts/partials/footer/custom.html new file mode 100644 index 0000000..e69de29 diff --git a/themes/hugo-theme-stack/layouts/partials/footer/footer.html b/themes/hugo-theme-stack/layouts/partials/footer/footer.html new file mode 100644 index 0000000..9c28779 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/footer/footer.html @@ -0,0 +1,23 @@ +{{- $ThemeVersion := "3.29.0" -}} + diff --git a/themes/hugo-theme-stack/layouts/partials/footer/include.html b/themes/hugo-theme-stack/layouts/partials/footer/include.html new file mode 100644 index 0000000..4b50a88 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/footer/include.html @@ -0,0 +1,3 @@ +{{ partialCached "footer/components/script.html" . }} +{{ partialCached "footer/components/custom-font.html" . }} +{{ partial "footer/custom.html" . }} \ No newline at end of file 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 diff --git a/themes/hugo-theme-stack/layouts/partials/helper/external.html b/themes/hugo-theme-stack/layouts/partials/helper/external.html new file mode 100644 index 0000000..88d9525 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/helper/external.html @@ -0,0 +1,29 @@ +{{- $List := index .Context.Site.Data.external .Namespace -}} +{{- with $List -}} + {{- range . -}} + {{- if eq .type "script" -}} + + {{- else if eq .type "style" -}} + + {{- else -}} + {{- errorf "Error: unknown external resource type: %s" .type -}} + {{- end -}} + {{- end -}} +{{- else -}} + {{- errorf "Error: external resource '%s' is not found" .Namespace -}} +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/helper/icon.html b/themes/hugo-theme-stack/layouts/partials/helper/icon.html new file mode 100644 index 0000000..72162e8 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/helper/icon.html @@ -0,0 +1,6 @@ +{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}} +{{- if $iconFile -}} + {{- $iconFile.Content | safeHTML -}} +{{- else -}} + {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}} +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/helper/image.html b/themes/hugo-theme-stack/layouts/partials/helper/image.html new file mode 100644 index 0000000..11fc3b6 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/helper/image.html @@ -0,0 +1,61 @@ +{{ $result := dict "exists" false "permalink" nil "resource" nil "isDefault" false }} +{{ $imageField := default "image" .Context.Site.Params.featuredImageField }} +{{ $imageValue := index .Context.Params $imageField }} + +{{ if $imageValue }} + + {{ $result = merge $result (dict "exists" true) }} + {{ $url := urls.Parse $imageValue }} + + {{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }} + + {{ $result = merge $result (dict "permalink" $imageValue) }} + {{ else }} + {{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }} + + {{ if $pageResourceImage }} + + {{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }} + + + {{ if ne (path.Ext $imageValue) ".svg" }} + {{ $result = merge $result (dict "resource" $pageResourceImage) }} + {{ end }} + {{ else }} + + {{ $result = merge $result (dict "permalink" (relURL $imageValue)) }} + {{ end }} + + {{ end }} + +{{ else if and (ne .Type nil) (index .Context.Site.Params.defaultImage .Type) }} + + {{ $defaultImageSetting := index .Context.Site.Params.defaultImage .Type }} + + {{ if $defaultImageSetting.enabled }} + {{ $result = merge $result (dict "isDefault" true) }} + {{ $result = merge $result (dict "exists" true) }} + + {{ if $defaultImageSetting.local }} + {{ $siteResourceImage := resources.GetMatch (printf "%s" ($defaultImageSetting.src | safeURL)) }} + + {{ if $siteResourceImage }} + + {{ $result = merge $result (dict "permalink" $siteResourceImage.RelPermalink) }} + {{ $result = merge $result (dict "resource" $siteResourceImage) }} + {{ else }} + + {{ errorf "Failed loading image: %q" $defaultImageSetting.src }} + {{ $result = merge $result (dict "exists" false) }} + {{ end }} + + {{ else }} + + {{ $result = merge $result (dict "permalink" (relURL $defaultImageSetting.src)) }} + {{ end }} + + {{ end }} + +{{ end }} + +{{ return $result }} diff --git a/themes/hugo-theme-stack/layouts/partials/pagination.html b/themes/hugo-theme-stack/layouts/partials/pagination.html new file mode 100644 index 0000000..7756050 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/pagination.html @@ -0,0 +1,26 @@ +{{ if gt .Paginator.TotalPages 1 }} + +{{ end }} diff --git a/themes/hugo-theme-stack/layouts/partials/sidebar/left.html b/themes/hugo-theme-stack/layouts/partials/sidebar/left.html new file mode 100644 index 0000000..21e7d3e --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/sidebar/left.html @@ -0,0 +1,103 @@ + diff --git a/themes/hugo-theme-stack/layouts/partials/sidebar/right.html b/themes/hugo-theme-stack/layouts/partials/sidebar/right.html new file mode 100644 index 0000000..6333f10 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/sidebar/right.html @@ -0,0 +1,16 @@ +{{- $scope := default "homepage" .Scope -}} +{{- $context := .Context -}} +{{- with (index .Context.Site.Params.widgets $scope) -}} + +{{ end }} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/widget/archives.html b/themes/hugo-theme-stack/layouts/partials/widget/archives.html new file mode 100644 index 0000000..1f2abc5 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/widget/archives.html @@ -0,0 +1,35 @@ +{{- $query := first 1 (where .Context.Site.Pages "Layout" "==" "archives") -}} +{{- $context := .Context -}} +{{- $limit := default 5 .Params.limit -}} +{{- if $query -}} + {{- $archivesPage := index $query 0 -}} +
+
+ {{ partial "helper/icon" "infinity" }} +
+

{{ T "widget.archives.title" }}

+ + {{ $pages := where $context.Site.RegularPages "Type" "in" $context.Site.Params.mainSections }} + {{ $notHidden := where $context.Site.RegularPages "Params.hidden" "!=" true }} + {{ $filtered := ($pages | intersect $notHidden) }} + {{ $archives := $filtered.GroupByDate "2006" }} + +
+ {{ range $index, $item := first (add $limit 1) ($archives) }} + {{- $id := lower (replace $item.Key " " "-") -}} + + {{ end }} +
+
+{{- else -}} + {{- warnf "Archives page not found. Create a page with layout: archives." -}} +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/widget/categories.html b/themes/hugo-theme-stack/layouts/partials/widget/categories.html new file mode 100644 index 0000000..10c8a35 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/widget/categories.html @@ -0,0 +1,16 @@ +{{- $context := .Context -}} +{{- $limit := default 10 .Params.limit -}} +
+
+ {{ partial "helper/icon" "categories" }} +
+

{{ T "widget.categoriesCloud.title" }}

+ +
+ {{ range first $limit $context.Site.Taxonomies.categories.ByCount }} + + {{ .Page.Title }} + + {{ end }} +
+
diff --git a/themes/hugo-theme-stack/layouts/partials/widget/search.html b/themes/hugo-theme-stack/layouts/partials/widget/search.html new file mode 100644 index 0000000..7b0fc73 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/widget/search.html @@ -0,0 +1,16 @@ +{{- $query := first 1 (where .Context.Site.Pages "Layout" "==" "search") -}} +{{- if $query -}} + {{- $searchPage := index $query 0 -}} +
+

+ + + + +

+
+{{- else -}} + {{- warnf "Search page not found. Create a page with layout: search." -}} +{{- end -}} \ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/widget/tag-cloud.html b/themes/hugo-theme-stack/layouts/partials/widget/tag-cloud.html new file mode 100644 index 0000000..e64e5e2 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/widget/tag-cloud.html @@ -0,0 +1,16 @@ +{{- $context := .Context -}} +{{- $limit := default 10 .Params.limit -}} +
+
+ {{ partial "helper/icon" "tag" }} +
+

{{ T "widget.tagCloud.title" }}

+ +
+ {{ range first $limit $context.Site.Taxonomies.tags.ByCount }} + + {{ .Page.Title }} + + {{ end }} +
+
\ No newline at end of file diff --git a/themes/hugo-theme-stack/layouts/partials/widget/toc.html b/themes/hugo-theme-stack/layouts/partials/widget/toc.html new file mode 100644 index 0000000..e311de3 --- /dev/null +++ b/themes/hugo-theme-stack/layouts/partials/widget/toc.html @@ -0,0 +1,12 @@ +{{ if (.Context.Scratch.Get "TOCEnabled") }} +
+
+ {{ partial "helper/icon" "hash" }} +
+

{{ T "article.tableOfContents" }}

+ +
+ {{ .Context.TableOfContents }} +
+
+{{ end }} \ No newline at end of file -- cgit v1.2.3