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/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 +++ 10 files changed, 262 insertions(+) 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 (limited to 'themes/hugo-theme-stack/layouts/partials/article') 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 -- cgit v1.2.3