From b3078d631b3cd44b0dda03d74ad062c91ecf6841 Mon Sep 17 00:00:00 2001 From: Paul Richardson Date: Sun, 11 Jan 2026 16:40:58 +0800 Subject: [PATCH 1/4] Strip partials/ from paths --- layouts/404.html | 2 +- layouts/_default/baseof.html | 8 ++++---- layouts/_default/list.html | 2 +- layouts/_default/single.html | 10 +++++----- layouts/gallery/list.html | 2 +- layouts/gallery/single.html | 8 ++++---- layouts/index.html | 2 +- layouts/story/single.html | 8 ++++---- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/layouts/404.html b/layouts/404.html index 824067c..b24dc79 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} -{{- partial "partials/shared/photomosaic.html" . -}} +{{- partial "shared/photomosaic.html" . -}} {{- end -}} {{- define "content" -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e942a84..362cbb1 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,15 +1,15 @@ - {{- partial "partials/shared/head.html" . -}} + {{- partial "shared/head.html" . -}}
- {{- partial "partials/shared/logo-and-navigation.html" . -}} + {{- partial "shared/logo-and-navigation.html" . -}}
{{- block "photomosaic" . }}{{- end }} {{- block "content" . }}{{- end }}
- {{- partial "partials/shared/footer.html" . -}} + {{- partial "shared/footer.html" . -}}
- {{- partial "partials/shared/js.html" . -}} + {{- partial "shared/js.html" . -}} \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 616f972..80de965 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} - {{- partial "partials/shared/photomosaic.html" . -}} + {{- partial "shared/photomosaic.html" . -}} {{- end -}} {{ define "content"}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 05d03af..9f0359c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} - {{- partial "partials/shared/photomosaic.html" . -}} + {{- partial "shared/photomosaic.html" . -}} {{- end -}} {{ define "content"}} @@ -18,9 +18,9 @@ {{- if and (eq $titleGalleryLen 0) (eq $coverImageLen 0) -}}{{- $topRadius = " post_text_top_radius" -}}{{- end -}}

{{ .Title }}

@@ -34,7 +34,7 @@

{{ .Title }}

- {{- partial "partials/remark42/comments.html" . -}} + {{- partial "remark42/comments.html" . -}}
diff --git a/layouts/gallery/list.html b/layouts/gallery/list.html index c412054..d7514c6 100644 --- a/layouts/gallery/list.html +++ b/layouts/gallery/list.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} -{{- partial "partials/shared/photomosaic.html" . -}} +{{- partial "shared/photomosaic.html" . -}} {{- end -}} {{- define "content" -}} diff --git a/layouts/gallery/single.html b/layouts/gallery/single.html index c1a1ccc..138cb49 100644 --- a/layouts/gallery/single.html +++ b/layouts/gallery/single.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} -{{- partial "partials/shared/photomosaic.html" . -}} +{{- partial "shared/photomosaic.html" . -}} {{- end -}} {{- define "content" -}} @@ -29,8 +29,8 @@

{{ .Title }}

@@ -76,7 +76,7 @@

{{ .Title }}

- {{- partial "partials/remark42/comments.html" . -}} + {{- partial "remark42/comments.html" . -}} diff --git a/layouts/index.html b/layouts/index.html index 89d69c4..d4fdc3b 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} - {{- partial "partials/shared/photomosaic.html" . -}} + {{- partial "shared/photomosaic.html" . -}} {{- end -}} {{- define "content" -}} diff --git a/layouts/story/single.html b/layouts/story/single.html index 7f9475d..06d23a8 100644 --- a/layouts/story/single.html +++ b/layouts/story/single.html @@ -1,5 +1,5 @@ {{- define "photomosaic" -}} -{{- partial "partials/shared/photomosaic.html" . -}} +{{- partial "shared/photomosaic.html" . -}} {{- end -}} {{- define "content" -}} @@ -78,12 +78,12 @@ {{- if .Title -}}

{{ .Title }}

{{- end -}}
- {{- partial "partials/shared/tags.html" . -}} - {{- partial "partials/shared/date.html" . -}} + {{- partial "shared/tags.html" . -}} + {{- partial "shared/date.html" . -}}
- {{- partial "partials/remark42/comments.html" . -}} + {{- partial "remark42/comments.html" . -}} From 0517f18750dbfb4917b14437391ea41ef752ce6f Mon Sep 17 00:00:00 2001 From: Paul Richardson Date: Sun, 11 Jan 2026 16:42:30 +0800 Subject: [PATCH 2/4] move partials to _partials and strip partials/ from path --- layouts/_partials/list/full-width-post.html | 9 +++++++++ layouts/_partials/list/one-third-width-post.html | 5 +++++ layouts/partials/list/full-width-post.html | 9 --------- layouts/partials/list/one-third-width-post.html | 5 ----- 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 layouts/_partials/list/full-width-post.html create mode 100644 layouts/_partials/list/one-third-width-post.html delete mode 100644 layouts/partials/list/full-width-post.html delete mode 100644 layouts/partials/list/one-third-width-post.html diff --git a/layouts/_partials/list/full-width-post.html b/layouts/_partials/list/full-width-post.html new file mode 100644 index 0000000..6c4f39a --- /dev/null +++ b/layouts/_partials/list/full-width-post.html @@ -0,0 +1,9 @@ +{{- if eq .Page.Type "gallery" -}} + {{- partial "list/full-width-gallery.html" . -}} +{{- else if eq .Page.Type "note" -}} + {{- partial "list/full-width-note.html" . -}} +{{- else if eq .Page.Type "story" -}} + {{- partial "list/full-width-story.html" . -}} +{{- else -}} + {{- partial "list/full-width-blog.html" . -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/_partials/list/one-third-width-post.html b/layouts/_partials/list/one-third-width-post.html new file mode 100644 index 0000000..7112448 --- /dev/null +++ b/layouts/_partials/list/one-third-width-post.html @@ -0,0 +1,5 @@ +{{- if eq .Page.Type "gallery" -}} + {{- partial "list/one-third-width-gallery.html" . -}} +{{- else -}} + {{- partial "list/one-third-width-blog.html" . -}} +{{- end -}} \ No newline at end of file diff --git a/layouts/partials/list/full-width-post.html b/layouts/partials/list/full-width-post.html deleted file mode 100644 index 407d766..0000000 --- a/layouts/partials/list/full-width-post.html +++ /dev/null @@ -1,9 +0,0 @@ -{{- if eq .Page.Type "gallery" -}} - {{- partial "partials/list/full-width-gallery.html" . -}} -{{- else if eq .Page.Type "note" -}} - {{- partial "partials/list/full-width-note.html" . -}} -{{- else if eq .Page.Type "story" -}} - {{- partial "partials/list/full-width-story.html" . -}} -{{- else -}} - {{- partial "partials/list/full-width-blog.html" . -}} -{{- end -}} \ No newline at end of file diff --git a/layouts/partials/list/one-third-width-post.html b/layouts/partials/list/one-third-width-post.html deleted file mode 100644 index 852a1af..0000000 --- a/layouts/partials/list/one-third-width-post.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- if eq .Page.Type "gallery" -}} - {{- partial "partials/list/one-third-width-gallery.html" . -}} -{{- else -}} - {{- partial "partials/list/one-third-width-blog.html" . -}} -{{- end -}} \ No newline at end of file From 0140f735130c31bf1041e49caeefd0c9a8a82654 Mon Sep 17 00:00:00 2001 From: Paul Richardson Date: Sun, 11 Jan 2026 16:43:30 +0800 Subject: [PATCH 3/4] move partials to _partials --- layouts/_partials/_funcs/get-page-images.html | 59 +++++++++++++++ .../_partials/embedded-gallery-partial.html | 39 ++++++++++ layouts/_partials/list/full-width-blog.html | 27 +++++++ .../_partials/list/full-width-gallery.html | 72 ++++++++++++++++++ layouts/_partials/list/full-width-note.html | 27 +++++++ layouts/_partials/list/full-width-story.html | 73 +++++++++++++++++++ .../_partials/list/one-third-width-blog.html | 20 +++++ .../list/one-third-width-gallery.html | 50 +++++++++++++ layouts/_partials/remark42/comments.html | 12 +++ layouts/_partials/shared/date.html | 3 + layouts/_partials/shared/footer.html | 24 ++++++ layouts/_partials/shared/ga.html | 9 +++ layouts/_partials/shared/head.html | 36 +++++++++ layouts/_partials/shared/js.html | 37 ++++++++++ .../shared/links-to-translations.html | 7 ++ .../_partials/shared/logo-and-navigation.html | 19 +++++ layouts/_partials/shared/opengraph.html | 69 ++++++++++++++++++ .../_partials/shared/photomosaic-data.html | 50 +++++++++++++ .../_partials/shared/photomosaic-impl.html | 37 ++++++++++ layouts/_partials/shared/photomosaic.html | 18 +++++ .../shared/post-title-image-or-gallery.html | 11 +++ layouts/_partials/shared/tags.html | 10 +++ 22 files changed, 709 insertions(+) create mode 100644 layouts/_partials/_funcs/get-page-images.html create mode 100644 layouts/_partials/embedded-gallery-partial.html create mode 100644 layouts/_partials/list/full-width-blog.html create mode 100644 layouts/_partials/list/full-width-gallery.html create mode 100644 layouts/_partials/list/full-width-note.html create mode 100644 layouts/_partials/list/full-width-story.html create mode 100644 layouts/_partials/list/one-third-width-blog.html create mode 100644 layouts/_partials/list/one-third-width-gallery.html create mode 100644 layouts/_partials/remark42/comments.html create mode 100644 layouts/_partials/shared/date.html create mode 100644 layouts/_partials/shared/footer.html create mode 100644 layouts/_partials/shared/ga.html create mode 100644 layouts/_partials/shared/head.html create mode 100644 layouts/_partials/shared/js.html create mode 100644 layouts/_partials/shared/links-to-translations.html create mode 100644 layouts/_partials/shared/logo-and-navigation.html create mode 100644 layouts/_partials/shared/opengraph.html create mode 100644 layouts/_partials/shared/photomosaic-data.html create mode 100644 layouts/_partials/shared/photomosaic-impl.html create mode 100644 layouts/_partials/shared/photomosaic.html create mode 100644 layouts/_partials/shared/post-title-image-or-gallery.html create mode 100644 layouts/_partials/shared/tags.html diff --git a/layouts/_partials/_funcs/get-page-images.html b/layouts/_partials/_funcs/get-page-images.html new file mode 100644 index 0000000..e03635e --- /dev/null +++ b/layouts/_partials/_funcs/get-page-images.html @@ -0,0 +1,59 @@ +{{- $imgs := slice }} +{{- if or (eq .Page.Type "gallery") (eq .Page.Type "story") -}} + {{ $images := .Resources.ByType "image" }} + {{- range first 10 $images -}} + {{- $image := .Fit "1920x1920 q90" -}} + {{- $imgs = $imgs | append (dict + "Image" $image + "RelPermalink" ($image.RelPermalink | relURL) + "Permalink" $image.Permalink) + -}} + {{- end -}} +{{- else -}} + {{- $imgParams := .Params.images }} + {{- $resources := .Resources.ByType "image" -}} + {{/* Find featured image resources if the images parameter is empty. */}} + {{- if not $imgParams }} + {{- $featured := $resources.GetMatch "*feature*" -}} + {{- if not $featured }}{{ $featured = $resources.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} + {{- with $featured }} + {{- $imgs = $imgs | append (dict + "Image" . + "RelPermalink" .RelPermalink + "Permalink" .Permalink) }} + {{- end }} + {{- end }} + {{/* Use the first one of site images as the fallback. */}} + {{- if and (not $imgParams) (not $imgs) }} + {{- with site.Params.images }} + {{- $imgParams = first 1 . }} + {{- end }} + {{- end }} + {{/* Parse page's images parameter. */}} + {{- range $imgParams }} + {{- $img := . }} + {{- $url := urls.Parse $img }} + {{- if eq $url.Scheme "" }} + {{/* Internal image. */}} + {{- with $resources.GetMatch $img -}} + {{/* Image resource. */}} + {{- $imgs = $imgs | append (dict + "Image" . + "RelPermalink" .RelPermalink + "Permalink" .Permalink) }} + {{- else }} + {{- $imgs = $imgs | append (dict + "RelPermalink" (relURL $img) + "Permalink" (absURL $img) + ) }} + {{- end }} + {{- else }} + {{/* External image */}} + {{- $imgs = $imgs | append (dict + "RelPermalink" $img + "Permalink" $img + ) }} + {{- end }} + {{- end }} +{{- end -}} +{{- return $imgs }} \ No newline at end of file diff --git a/layouts/_partials/embedded-gallery-partial.html b/layouts/_partials/embedded-gallery-partial.html new file mode 100644 index 0000000..8408467 --- /dev/null +++ b/layouts/_partials/embedded-gallery-partial.html @@ -0,0 +1,39 @@ +{{- $page := . -}} + +{{ $titleGalleryName := $page.Params.title_gallery }} +{{- $path := printf "%s%s" "/embedded-gallery/" $titleGalleryName -}} +{{ $gallery := .Site.GetPage $path }} + +{{ $lines := split $gallery.RawContent "\n" }} +{{ $map := dict }} +{{ range $lines }} + {{ $descr := split . ";" }} + {{ $map = merge $map (dict (index $descr 0) (index $descr 1)) }} +{{ end }} + +
+ +
+
diff --git a/layouts/_partials/list/full-width-blog.html b/layouts/_partials/list/full-width-blog.html new file mode 100644 index 0000000..9a756cd --- /dev/null +++ b/layouts/_partials/list/full-width-blog.html @@ -0,0 +1,27 @@ +
+
+ {{ partial "shared/post-title-image-or-gallery.html" . }} + {{- $topRadius := "" -}} + {{- $images := .Resources.ByType "image" -}} + {{- $image := ($images.GetMatch "*cover*") -}} + {{- $titleGalleryLen := len (string .Page.Params.title_gallery) -}} + {{- $coverImageLen := len (string $image) -}} + {{- if and (eq $titleGalleryLen 0) (eq $coverImageLen 0) -}}{{- $topRadius = " post_text_top_radius" -}}{{- end -}} +
+ +

{{ .Title }}

+
+ {{ if in .RawContent "" }} + {{ .Summary }} + {{ else }} +

{{ .Summary | markdownify }}

+ {{ end }} +
+ {{- if .Truncated -}}
{{ i18n "readMore" }} ➠
{{- end -}} +
+
+
\ No newline at end of file diff --git a/layouts/_partials/list/full-width-gallery.html b/layouts/_partials/list/full-width-gallery.html new file mode 100644 index 0000000..08f0009 --- /dev/null +++ b/layouts/_partials/list/full-width-gallery.html @@ -0,0 +1,72 @@ +{{ $gallery := . }} + +{{ $lines := split $gallery.RawContent "\n" }} +{{ $map := dict }} +{{- $videos := dict -}} +{{ range $lines }} + {{ $descr := split . ";" }} + {{- if strings.Contains (index $descr 0) ":" -}} + {{- $imgVideo := split (index $descr 0) ":" -}} + {{ $map = merge $map (dict (index $imgVideo 0) (index $descr 1)) }} + {{- $videos = merge $videos (dict (index $imgVideo 0) (index $imgVideo 1)) -}} + {{- else -}} + {{ $map = merge $map (dict (index $descr 0) (index $descr 1)) }} + {{- end -}} +{{ end }} + +
+
+
+ +

{{ .Title }}

+ +
+ +
+
{{ i18n "fullGallery" }} ➠
+
+
+
\ No newline at end of file diff --git a/layouts/_partials/list/full-width-note.html b/layouts/_partials/list/full-width-note.html new file mode 100644 index 0000000..8589724 --- /dev/null +++ b/layouts/_partials/list/full-width-note.html @@ -0,0 +1,27 @@ +
+
+ {{ partial "shared/post-title-image-or-gallery.html" . }} + {{- $topRadius := "" -}} + {{- $images := .Resources.ByType "image" -}} + {{- $image := ($images.GetMatch "*cover*") -}} + {{- $titleGalleryLen := len (string .Page.Params.title_gallery) -}} + {{- $coverImageLen := len (string $image) -}} + {{- if and (eq $titleGalleryLen 0) (eq $coverImageLen 0) -}}{{- $topRadius = " post_text_top_radius" -}}{{- end -}} +
+ +

{{ .Title }}

+
+ {{ if in .RawContent "" }} + {{ .Summary }} + {{ else }} +

{{ .Summary | markdownify }}

+ {{ end }} +
+ {{- if .Truncated -}}
{{ i18n "readMore" }} ➠
{{- end -}} +
+
+
\ No newline at end of file diff --git a/layouts/_partials/list/full-width-story.html b/layouts/_partials/list/full-width-story.html new file mode 100644 index 0000000..a08baa6 --- /dev/null +++ b/layouts/_partials/list/full-width-story.html @@ -0,0 +1,73 @@ +
+
+ {{ partial "shared/post-title-image-or-gallery.html" . }} + {{- $topRadius := " post_text_top_radius" -}} +
+
+ +
+
+ {{- if .Title -}}

{{ .Title }}

{{- end -}} +
+
+
\ No newline at end of file diff --git a/layouts/_partials/list/one-third-width-blog.html b/layouts/_partials/list/one-third-width-blog.html new file mode 100644 index 0000000..c3e2142 --- /dev/null +++ b/layouts/_partials/list/one-third-width-blog.html @@ -0,0 +1,20 @@ +
+
+ {{ partial "shared/post-title-image-or-gallery.html" . }} +
+ +

{{ .Title }}

+
+ {{ if in .RawContent "" }} + {{ .Summary | safeHTML }} + {{ else }} +

{{ .Summary | safeHTML }}

+ {{ end }} +
+
{{ i18n "readMore" }} ➠
+
+
+
\ No newline at end of file diff --git a/layouts/_partials/list/one-third-width-gallery.html b/layouts/_partials/list/one-third-width-gallery.html new file mode 100644 index 0000000..14c1f2e --- /dev/null +++ b/layouts/_partials/list/one-third-width-gallery.html @@ -0,0 +1,50 @@ +{{- $gallery := . -}} + +{{- $lines := split $gallery.RawContent "\n" -}} +{{- $map := dict -}} +{{- range $lines -}} + {{- $descr := split . ";" -}} + {{- $map = merge $map (dict (index $descr 0) (index $descr 1)) -}} +{{- end -}} + +
+
+ +
+
+
+ +

{{- .Title -}}

+
{{- i18n "fullGallery" -}} ➠
+
+
+ \ No newline at end of file diff --git a/layouts/_partials/remark42/comments.html b/layouts/_partials/remark42/comments.html new file mode 100644 index 0000000..b07ee36 --- /dev/null +++ b/layouts/_partials/remark42/comments.html @@ -0,0 +1,12 @@ +{{ if .Param "remark_enabled" }} + + +
+
+
+{{ end }} \ No newline at end of file diff --git a/layouts/_partials/shared/date.html b/layouts/_partials/shared/date.html new file mode 100644 index 0000000..3b7450f --- /dev/null +++ b/layouts/_partials/shared/date.html @@ -0,0 +1,3 @@ + diff --git a/layouts/_partials/shared/footer.html b/layouts/_partials/shared/footer.html new file mode 100644 index 0000000..818b149 --- /dev/null +++ b/layouts/_partials/shared/footer.html @@ -0,0 +1,24 @@ +
+ +
diff --git a/layouts/_partials/shared/ga.html b/layouts/_partials/shared/ga.html new file mode 100644 index 0000000..3f8b736 --- /dev/null +++ b/layouts/_partials/shared/ga.html @@ -0,0 +1,9 @@ + + + diff --git a/layouts/_partials/shared/head.html b/layouts/_partials/shared/head.html new file mode 100644 index 0000000..1e68eeb --- /dev/null +++ b/layouts/_partials/shared/head.html @@ -0,0 +1,36 @@ + + + + + {{ hugo.Generator }} + {{ with .Site.Params.logo }}{{ end }} + {{ .Page.Title }} | {{ .Site.Title }} + {{ with .Site.Params.meta.description }}{{ end }} + {{ with .Site.Params.meta.keywords }}{{ end }} + {{ with .Site.Params.canonicalURL }}{{ end }} + + {{- partial "shared/opengraph.html" . -}} + + {{- $booststrap := resources.Get "/css/bootstrap.min.css" | resources.Fingerprint -}} + {{- $themeModules := resources.Get "/css/theme-modules.css" | resources.Fingerprint -}} + {{- $photoMosaic := resources.Get "/css/photo-mosaic.css" | resources.Fingerprint -}} + {{- $lightGallery := resources.Get "/libs/lightgallery/css/lightgallery.css" | resources.Fingerprint -}} + {{- $lgFullscreen := resources.Get "/libs/lightgallery/css/lg-fullscreen.css" | resources.Fingerprint -}} + {{- $lgVideo := resources.Get "/libs/lightgallery/css/lg-video.css" | resources.Fingerprint -}} + {{- $lgMediumZoom := resources.Get "/libs/lightgallery/css/lg-medium-zoom.css" | resources.Fingerprint -}} + {{- $lgThumbnail := resources.Get "/libs/lightgallery/css/lg-thumbnail.css" | resources.Fingerprint -}} + {{- $lgPager := resources.Get "/libs/lightgallery/css/lg-pager.css" | resources.Fingerprint -}} + {{- $swiper := resources.Get "/libs/swiper/swiper-bundle.min.css" | resources.Fingerprint -}} + {{- $custom := resources.Get "/css/custom.css" | resources.Fingerprint -}} + + + + + + + + + + + + \ No newline at end of file diff --git a/layouts/_partials/shared/js.html b/layouts/_partials/shared/js.html new file mode 100644 index 0000000..c65a5af --- /dev/null +++ b/layouts/_partials/shared/js.html @@ -0,0 +1,37 @@ +{{- $jquery := resources.Get "/js/jquery.min.js" | resources.Fingerprint -}} +{{- $bootstrap := resources.Get "/js/plugins/bootstrap.bundle.min.js" | resources.Fingerprint -}} + + + +{{ $lightGalleryLicenseKey := "" }} +{{- if .Site.Params.lightgallery.licenseKey -}} + {{ $lightGalleryLicenseKey = $.Site.Params.lightgallery.licenseKey }} +{{ else }} + {{ $lightGalleryLicenseKey = "0000-0000-000-0000" }} +{{- end -}} + +{{- $lightgallery := resources.Get "/libs/lightgallery/lightgallery.min.js" | resources.Fingerprint -}} +{{- $lgFullscreen := resources.Get "/libs/lightgallery/plugins/fullscreen/lg-fullscreen.min.js" | resources.Fingerprint -}} +{{- $lgMediumZoom := resources.Get "/libs/lightgallery/plugins/mediumZoom/lg-medium-zoom.min.js" | resources.Fingerprint -}} +{{- $lgThumbnail := resources.Get "/libs/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" | resources.Fingerprint -}} +{{- $lgVideo := resources.Get "/libs/lightgallery/plugins/video/lg-video.min.js" | resources.Fingerprint -}} +{{- $lgPager := resources.Get "/libs/lightgallery/plugins/pager/lg-pager.min.js" | resources.Fingerprint -}} +{{- $lgHash := resources.Get "/libs/lightgallery/plugins/hash/lg-hash.min.js" | resources.Fingerprint -}} +{{- $swiper := resources.Get "/libs/swiper/swiper-bundle.min.js" | resources.Fingerprint -}} +{{- $masonry := resources.Get "/libs/masonry/masonry.pkgd.min.js" | resources.Fingerprint -}} +{{- $imagesloaded := resources.Get "/libs/masonry/imagesloaded.pkgd.min.js" | resources.Fingerprint -}} +{{- $init := resources.Get "/js/init.js" | resources.Fingerprint -}} + + + + + + + + + + + + + +{{- partialCached "shared/ga.html" . -}} \ No newline at end of file diff --git a/layouts/_partials/shared/links-to-translations.html b/layouts/_partials/shared/links-to-translations.html new file mode 100644 index 0000000..f51a65d --- /dev/null +++ b/layouts/_partials/shared/links-to-translations.html @@ -0,0 +1,7 @@ +{{- if .Page.IsTranslated -}} + +{{- end -}} diff --git a/layouts/_partials/shared/logo-and-navigation.html b/layouts/_partials/shared/logo-and-navigation.html new file mode 100644 index 0000000..5aeb655 --- /dev/null +++ b/layouts/_partials/shared/logo-and-navigation.html @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/layouts/_partials/shared/opengraph.html b/layouts/_partials/shared/opengraph.html new file mode 100644 index 0000000..f5eea64 --- /dev/null +++ b/layouts/_partials/shared/opengraph.html @@ -0,0 +1,69 @@ +{{- $defaultDescription := "" -}} +{{- with .Description -}} + {{- $defaultDescription = . -}} +{{- else -}} + {{- if .IsPage -}} + {{- $defaultDescription = .Summary -}} + {{- else -}} + {{- with .Site.Params.description -}} + {{- $defaultDescription = . -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- if or (eq .Page.Type "gallery") (eq .Page.Type "story") -}} + {{- $defaultDescription = .Title -}} +{{- end -}} + + + + + +{{- $images := partial "_funcs/get-page-images" . -}} +{{- range first 6 $images -}} + +{{- end -}} + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} + +{{ with .PublishDate }}{{ end }} +{{ with .Lastmod }}{{ end }} +{{- end -}} + +{{- with .Params.audio }}{{ end }} +{{- with .Params.locale }}{{ end }} +{{- with .Site.Params.title }}{{ end }} +{{- with .Params.videos }}{{- range . }} + +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }} +{{- if $siteSeries }} +{{ with .Params.series }}{{- range $name := . }} +{{- $series := index $siteSeries ($name | urlize) }} +{{- range $page := first 6 $series.Pages }} +{{- if ne $page.Permalink $permalink }}{{ end }} +{{- end }} +{{ end }}{{ end }} +{{- end }} + +{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} +{{- $facebookAdmin := "" }} +{{- with site.Params.social }} +{{- if reflect.IsMap . }} +{{- $facebookAdmin = .facebook_admin }} +{{- end }} +<<<<<<< Updated upstream:layouts/partials/shared/opengraph.html +======= +{{- else }} +{{- with site.Params.Social.facebook_admin }} +{{- $facebookAdmin = . }} +{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} +{{- end }} +>>>>>>> Stashed changes:layouts/_partials/shared/opengraph.html +{{- end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{ with $facebookAdmin }}{{ end }} diff --git a/layouts/_partials/shared/photomosaic-data.html b/layouts/_partials/shared/photomosaic-data.html new file mode 100644 index 0000000..23db06a --- /dev/null +++ b/layouts/_partials/shared/photomosaic-data.html @@ -0,0 +1,50 @@ +{{- $photos := slice -}} +{{- $dirs := slice -}} +{{- $photoDescriptions := dict -}} +{{- $allowedExtentions := ".jpg .jpeg .gif .tiff .webp .svg .eps .ai .xcf .png" -}} + +{{- if fileExists "/content/gallery" -}} + {{- range readDir "/content/gallery" -}} + {{- $dirs = $dirs | append (printf "%s/%s" "/content/gallery" .Name) -}} + {{- end -}} +{{- end -}} + +{{- if fileExists "/content/story" -}} + {{- range readDir "/content/story" -}} + {{- $dirs = $dirs | append (printf "%s/%s" "/content/story" .Name) -}} + {{- end -}} +{{- end -}} + +{{- range $dir := $dirs -}} + {{- $galleries := readDir $dir -}} + {{- range $galleries -}} + {{- $galleryPath := printf "%s/%s" $dir .Name -}} + {{- $galleryContentPath := printf "%s/%s" (replace $dir "/content" "") .Name -}} + + {{- $gallery := $.Site.GetPage $galleryContentPath -}} + {{- $galleryPath := $gallery.RelPermalink -}} + {{- $galleryTitle := $gallery.Title -}} + + {{- $descriptions := dict -}} + + {{- $lines := split $gallery.RawContent "\n" -}} + {{- range $lines -}} + {{- $descr := split . ";" -}} + {{- if strings.Contains (index $descr 0) ":" -}} + {{- $imgVideo := split (index $descr 0) ":" -}} + {{- $descriptions = merge $descriptions (dict (index $imgVideo 0) (index $descr 1)) -}} + {{- else -}} + {{- $descriptions = merge $descriptions (dict (index $descr 0) (index $descr 1)) -}} + {{- end -}} + {{- end -}} + + {{- range $gallery.Resources.ByType "image" -}} + {{- $photos = $photos | append . -}} + {{/* $photoDescriptions is a map of type String => (File, String, String) */}} + {{/* where key is a file name, value is a tuple of (image, file description, gallery path, gallery title) */}} + {{- $photoDescriptions = merge $photoDescriptions (dict .Name (slice . (index $descriptions .Name ) $galleryPath $galleryTitle )) -}} + {{- end -}} + {{- end -}} +{{- end -}} + +{{- return $photoDescriptions -}} diff --git a/layouts/_partials/shared/photomosaic-impl.html b/layouts/_partials/shared/photomosaic-impl.html new file mode 100644 index 0000000..675a87f --- /dev/null +++ b/layouts/_partials/shared/photomosaic-impl.html @@ -0,0 +1,37 @@ + {{- $photomosiacData := (partialCached "shared/photomosaic-data.html" . ) -}} + {{- $randomPhotos := slice -}} + {{- range $index, $unused := $photomosiacData -}} + {{- $randomPhotos = $randomPhotos | append $index -}} + {{- end -}} + + {{- $randomPhotos = shuffle $randomPhotos -}} + {{- $randomPhotos = first 31 $randomPhotos -}} + +
+ {{- range $randomPhotos -}} + {{- $randomPhoto := index $photomosiacData . -}} + {{- $photo := index $randomPhoto 0 -}} + {{- $descr := index $randomPhoto 1 -}} + {{- $galleryPath := index $randomPhoto 2 -}} + {{- $galleryTitle := index $randomPhoto 3 -}} + {{- $text := printf "%s. %s" $galleryTitle $descr -}} + {{- $thumb := $photo.Fill "200x150 q100" -}} + {{- with $photo.Exif -}} + {{- if eq 6 .Tags.Orientation -}} + {{- $thumb = $photo.Fill "200x150 q100 r270" -}} + {{- else if eq 8 .Tags.Orientation -}} + {{- $thumb = $photo.Fill "200x150 q100 r90" -}} + {{- else if eq 3 .Tags.Orientation -}} + {{- $thumb = $photo.Fill "200x150 q100 r180" -}} + {{- end -}} + {{- end -}} + + +
+
+ {{ $text }} +
+
+
+ {{- end -}} +
diff --git a/layouts/_partials/shared/photomosaic.html b/layouts/_partials/shared/photomosaic.html new file mode 100644 index 0000000..ba7bb50 --- /dev/null +++ b/layouts/_partials/shared/photomosaic.html @@ -0,0 +1,18 @@ +
+
+
+ {{- if (eq .Page.Kind "term") -}} +

{{ i18n "blog" }} #{{- .Data.Term -}}

+ {{ else if and (eq .Page.Kind "section") (eq .Page.Type "gallery") -}} +

{{ i18n "photogalleries" }}

+ {{ else if and (eq .Page.Kind "section") (eq .Page.Type "story") -}} +

{{ i18n "stories" }}

+ {{- end -}} +
+
+ + {{- $seq := seq .Site.Params.photomosaic.numberOfUniqueMosaics -}} + {{- $seq = shuffle $seq -}} + {{- $cacheId := first 1 $seq -}} + {{- partialCached "shared/photomosaic-impl.html" . $cacheId -}} +
\ No newline at end of file diff --git a/layouts/_partials/shared/post-title-image-or-gallery.html b/layouts/_partials/shared/post-title-image-or-gallery.html new file mode 100644 index 0000000..c903b79 --- /dev/null +++ b/layouts/_partials/shared/post-title-image-or-gallery.html @@ -0,0 +1,11 @@ +{{ $titleGallery := .Page.Params.title_gallery }} +{{ if $titleGallery }} + {{ partial "embedded-gallery-partial.html" . $titleGallery }} +{{ else }} + {{ $images := .Resources.ByType "image" }} + {{ with $image := ($images.GetMatch "*cover*") }} +
+ {{ .Title }} +
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/layouts/_partials/shared/tags.html b/layouts/_partials/shared/tags.html new file mode 100644 index 0000000..efd79f2 --- /dev/null +++ b/layouts/_partials/shared/tags.html @@ -0,0 +1,10 @@ +{{- with .GetTerms "tags" -}} +{{- $size := . | len -}} + {{- if gt $size 0 -}} + + {{- end -}} +{{- end -}} \ No newline at end of file From ceb52f193968f5658e2b9302cfc7c5540fb3d92c Mon Sep 17 00:00:00 2001 From: Paul Richardson Date: Fri, 24 Apr 2026 14:23:50 +0300 Subject: [PATCH 4/4] Remove partials --- layouts/partials/_funcs/get-page-images.html | 59 --------------- .../partials/embedded-gallery-partial.html | 39 ---------- layouts/partials/list/full-width-blog.html | 27 ------- layouts/partials/list/full-width-gallery.html | 72 ------------------ layouts/partials/list/full-width-note.html | 27 ------- layouts/partials/list/full-width-story.html | 73 ------------------- .../partials/list/one-third-width-blog.html | 20 ----- .../list/one-third-width-gallery.html | 50 ------------- layouts/partials/remark42/comments.html | 12 --- layouts/partials/shared/date.html | 3 - layouts/partials/shared/footer.html | 24 ------ layouts/partials/shared/ga.html | 9 --- layouts/partials/shared/head.html | 36 --------- layouts/partials/shared/js.html | 37 ---------- .../shared/links-to-translations.html | 7 -- .../partials/shared/logo-and-navigation.html | 19 ----- layouts/partials/shared/opengraph.html | 61 ---------------- layouts/partials/shared/photomosaic-data.html | 50 ------------- layouts/partials/shared/photomosaic-impl.html | 37 ---------- layouts/partials/shared/photomosaic.html | 18 ----- .../shared/post-title-image-or-gallery.html | 11 --- layouts/partials/shared/tags.html | 10 --- 22 files changed, 701 deletions(-) delete mode 100644 layouts/partials/_funcs/get-page-images.html delete mode 100644 layouts/partials/embedded-gallery-partial.html delete mode 100644 layouts/partials/list/full-width-blog.html delete mode 100644 layouts/partials/list/full-width-gallery.html delete mode 100644 layouts/partials/list/full-width-note.html delete mode 100644 layouts/partials/list/full-width-story.html delete mode 100644 layouts/partials/list/one-third-width-blog.html delete mode 100644 layouts/partials/list/one-third-width-gallery.html delete mode 100644 layouts/partials/remark42/comments.html delete mode 100644 layouts/partials/shared/date.html delete mode 100644 layouts/partials/shared/footer.html delete mode 100644 layouts/partials/shared/ga.html delete mode 100644 layouts/partials/shared/head.html delete mode 100644 layouts/partials/shared/js.html delete mode 100644 layouts/partials/shared/links-to-translations.html delete mode 100644 layouts/partials/shared/logo-and-navigation.html delete mode 100644 layouts/partials/shared/opengraph.html delete mode 100644 layouts/partials/shared/photomosaic-data.html delete mode 100644 layouts/partials/shared/photomosaic-impl.html delete mode 100644 layouts/partials/shared/photomosaic.html delete mode 100644 layouts/partials/shared/post-title-image-or-gallery.html delete mode 100644 layouts/partials/shared/tags.html diff --git a/layouts/partials/_funcs/get-page-images.html b/layouts/partials/_funcs/get-page-images.html deleted file mode 100644 index e03635e..0000000 --- a/layouts/partials/_funcs/get-page-images.html +++ /dev/null @@ -1,59 +0,0 @@ -{{- $imgs := slice }} -{{- if or (eq .Page.Type "gallery") (eq .Page.Type "story") -}} - {{ $images := .Resources.ByType "image" }} - {{- range first 10 $images -}} - {{- $image := .Fit "1920x1920 q90" -}} - {{- $imgs = $imgs | append (dict - "Image" $image - "RelPermalink" ($image.RelPermalink | relURL) - "Permalink" $image.Permalink) - -}} - {{- end -}} -{{- else -}} - {{- $imgParams := .Params.images }} - {{- $resources := .Resources.ByType "image" -}} - {{/* Find featured image resources if the images parameter is empty. */}} - {{- if not $imgParams }} - {{- $featured := $resources.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $resources.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{- with $featured }} - {{- $imgs = $imgs | append (dict - "Image" . - "RelPermalink" .RelPermalink - "Permalink" .Permalink) }} - {{- end }} - {{- end }} - {{/* Use the first one of site images as the fallback. */}} - {{- if and (not $imgParams) (not $imgs) }} - {{- with site.Params.images }} - {{- $imgParams = first 1 . }} - {{- end }} - {{- end }} - {{/* Parse page's images parameter. */}} - {{- range $imgParams }} - {{- $img := . }} - {{- $url := urls.Parse $img }} - {{- if eq $url.Scheme "" }} - {{/* Internal image. */}} - {{- with $resources.GetMatch $img -}} - {{/* Image resource. */}} - {{- $imgs = $imgs | append (dict - "Image" . - "RelPermalink" .RelPermalink - "Permalink" .Permalink) }} - {{- else }} - {{- $imgs = $imgs | append (dict - "RelPermalink" (relURL $img) - "Permalink" (absURL $img) - ) }} - {{- end }} - {{- else }} - {{/* External image */}} - {{- $imgs = $imgs | append (dict - "RelPermalink" $img - "Permalink" $img - ) }} - {{- end }} - {{- end }} -{{- end -}} -{{- return $imgs }} \ No newline at end of file diff --git a/layouts/partials/embedded-gallery-partial.html b/layouts/partials/embedded-gallery-partial.html deleted file mode 100644 index 8408467..0000000 --- a/layouts/partials/embedded-gallery-partial.html +++ /dev/null @@ -1,39 +0,0 @@ -{{- $page := . -}} - -{{ $titleGalleryName := $page.Params.title_gallery }} -{{- $path := printf "%s%s" "/embedded-gallery/" $titleGalleryName -}} -{{ $gallery := .Site.GetPage $path }} - -{{ $lines := split $gallery.RawContent "\n" }} -{{ $map := dict }} -{{ range $lines }} - {{ $descr := split . ";" }} - {{ $map = merge $map (dict (index $descr 0) (index $descr 1)) }} -{{ end }} - -
- -
-
diff --git a/layouts/partials/list/full-width-blog.html b/layouts/partials/list/full-width-blog.html deleted file mode 100644 index e8a4553..0000000 --- a/layouts/partials/list/full-width-blog.html +++ /dev/null @@ -1,27 +0,0 @@ -
-
- {{ partial "shared/post-title-image-or-gallery.html" . }} - {{- $topRadius := "" -}} - {{- $images := .Resources.ByType "image" -}} - {{- $image := ($images.GetMatch "*cover*") -}} - {{- $titleGalleryLen := len (string .Page.Params.title_gallery) -}} - {{- $coverImageLen := len (string $image) -}} - {{- if and (eq $titleGalleryLen 0) (eq $coverImageLen 0) -}}{{- $topRadius = " post_text_top_radius" -}}{{- end -}} -
- -

{{ .Title }}

-
- {{ if in .RawContent "" }} - {{ .Summary }} - {{ else }} -

{{ .Summary | markdownify }}

- {{ end }} -
- {{- if .Truncated -}}
{{ i18n "readMore" }} ➠
{{- end -}} -
-
-
\ No newline at end of file diff --git a/layouts/partials/list/full-width-gallery.html b/layouts/partials/list/full-width-gallery.html deleted file mode 100644 index 6426fa8..0000000 --- a/layouts/partials/list/full-width-gallery.html +++ /dev/null @@ -1,72 +0,0 @@ -{{ $gallery := . }} - -{{ $lines := split $gallery.RawContent "\n" }} -{{ $map := dict }} -{{- $videos := dict -}} -{{ range $lines }} - {{ $descr := split . ";" }} - {{- if strings.Contains (index $descr 0) ":" -}} - {{- $imgVideo := split (index $descr 0) ":" -}} - {{ $map = merge $map (dict (index $imgVideo 0) (index $descr 1)) }} - {{- $videos = merge $videos (dict (index $imgVideo 0) (index $imgVideo 1)) -}} - {{- else -}} - {{ $map = merge $map (dict (index $descr 0) (index $descr 1)) }} - {{- end -}} -{{ end }} - -
-
-
- -

{{ .Title }}

- -
- -
-
{{ i18n "fullGallery" }} ➠
-
-
-
\ No newline at end of file diff --git a/layouts/partials/list/full-width-note.html b/layouts/partials/list/full-width-note.html deleted file mode 100644 index 04ecbb6..0000000 --- a/layouts/partials/list/full-width-note.html +++ /dev/null @@ -1,27 +0,0 @@ -
-
- {{ partial "shared/post-title-image-or-gallery.html" . }} - {{- $topRadius := "" -}} - {{- $images := .Resources.ByType "image" -}} - {{- $image := ($images.GetMatch "*cover*") -}} - {{- $titleGalleryLen := len (string .Page.Params.title_gallery) -}} - {{- $coverImageLen := len (string $image) -}} - {{- if and (eq $titleGalleryLen 0) (eq $coverImageLen 0) -}}{{- $topRadius = " post_text_top_radius" -}}{{- end -}} -
- -

{{ .Title }}

-
- {{ if in .RawContent "" }} - {{ .Summary }} - {{ else }} -

{{ .Summary | markdownify }}

- {{ end }} -
- {{- if .Truncated -}}
{{ i18n "readMore" }} ➠
{{- end -}} -
-
-
\ No newline at end of file diff --git a/layouts/partials/list/full-width-story.html b/layouts/partials/list/full-width-story.html deleted file mode 100644 index a08baa6..0000000 --- a/layouts/partials/list/full-width-story.html +++ /dev/null @@ -1,73 +0,0 @@ -
-
- {{ partial "shared/post-title-image-or-gallery.html" . }} - {{- $topRadius := " post_text_top_radius" -}} -
-
- -
-
- {{- if .Title -}}

{{ .Title }}

{{- end -}} -
-
-
\ No newline at end of file diff --git a/layouts/partials/list/one-third-width-blog.html b/layouts/partials/list/one-third-width-blog.html deleted file mode 100644 index ddf5627..0000000 --- a/layouts/partials/list/one-third-width-blog.html +++ /dev/null @@ -1,20 +0,0 @@ -
-
- {{ partial "shared/post-title-image-or-gallery.html" . }} -
- -

{{ .Title }}

-
- {{ if in .RawContent "" }} - {{ .Summary | safeHTML }} - {{ else }} -

{{ .Summary | safeHTML }}

- {{ end }} -
-
{{ i18n "readMore" }} ➠
-
-
-
\ No newline at end of file diff --git a/layouts/partials/list/one-third-width-gallery.html b/layouts/partials/list/one-third-width-gallery.html deleted file mode 100644 index d21d5b3..0000000 --- a/layouts/partials/list/one-third-width-gallery.html +++ /dev/null @@ -1,50 +0,0 @@ -{{- $gallery := . -}} - -{{- $lines := split $gallery.RawContent "\n" -}} -{{- $map := dict -}} -{{- range $lines -}} - {{- $descr := split . ";" -}} - {{- $map = merge $map (dict (index $descr 0) (index $descr 1)) -}} -{{- end -}} - -
-
- -
-
-
- -

{{- .Title -}}

-
{{- i18n "fullGallery" -}} ➠
-
-
- \ No newline at end of file diff --git a/layouts/partials/remark42/comments.html b/layouts/partials/remark42/comments.html deleted file mode 100644 index b07ee36..0000000 --- a/layouts/partials/remark42/comments.html +++ /dev/null @@ -1,12 +0,0 @@ -{{ if .Param "remark_enabled" }} - - -
-
-
-{{ end }} \ No newline at end of file diff --git a/layouts/partials/shared/date.html b/layouts/partials/shared/date.html deleted file mode 100644 index 3b7450f..0000000 --- a/layouts/partials/shared/date.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/layouts/partials/shared/footer.html b/layouts/partials/shared/footer.html deleted file mode 100644 index 818b149..0000000 --- a/layouts/partials/shared/footer.html +++ /dev/null @@ -1,24 +0,0 @@ -
- -
diff --git a/layouts/partials/shared/ga.html b/layouts/partials/shared/ga.html deleted file mode 100644 index 3f8b736..0000000 --- a/layouts/partials/shared/ga.html +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/layouts/partials/shared/head.html b/layouts/partials/shared/head.html deleted file mode 100644 index 9a63016..0000000 --- a/layouts/partials/shared/head.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - {{ hugo.Generator }} - {{ with .Site.Params.logo }}{{ end }} - {{ .Page.Title }} | {{ .Site.Title }} - {{ with .Site.Params.meta.description }}{{ end }} - {{ with .Site.Params.meta.keywords }}{{ end }} - {{ with .Site.Params.canonicalURL }}{{ end }} - - {{- partial "partials/shared/opengraph.html" . -}} - - {{- $booststrap := resources.Get "/css/bootstrap.min.css" | resources.Fingerprint -}} - {{- $themeModules := resources.Get "/css/theme-modules.css" | resources.Fingerprint -}} - {{- $photoMosaic := resources.Get "/css/photo-mosaic.css" | resources.Fingerprint -}} - {{- $lightGallery := resources.Get "/libs/lightgallery/css/lightgallery.css" | resources.Fingerprint -}} - {{- $lgFullscreen := resources.Get "/libs/lightgallery/css/lg-fullscreen.css" | resources.Fingerprint -}} - {{- $lgVideo := resources.Get "/libs/lightgallery/css/lg-video.css" | resources.Fingerprint -}} - {{- $lgMediumZoom := resources.Get "/libs/lightgallery/css/lg-medium-zoom.css" | resources.Fingerprint -}} - {{- $lgThumbnail := resources.Get "/libs/lightgallery/css/lg-thumbnail.css" | resources.Fingerprint -}} - {{- $lgPager := resources.Get "/libs/lightgallery/css/lg-pager.css" | resources.Fingerprint -}} - {{- $swiper := resources.Get "/libs/swiper/swiper-bundle.min.css" | resources.Fingerprint -}} - {{- $custom := resources.Get "/css/custom.css" | resources.Fingerprint -}} - - - - - - - - - - - - \ No newline at end of file diff --git a/layouts/partials/shared/js.html b/layouts/partials/shared/js.html deleted file mode 100644 index c65a5af..0000000 --- a/layouts/partials/shared/js.html +++ /dev/null @@ -1,37 +0,0 @@ -{{- $jquery := resources.Get "/js/jquery.min.js" | resources.Fingerprint -}} -{{- $bootstrap := resources.Get "/js/plugins/bootstrap.bundle.min.js" | resources.Fingerprint -}} - - - -{{ $lightGalleryLicenseKey := "" }} -{{- if .Site.Params.lightgallery.licenseKey -}} - {{ $lightGalleryLicenseKey = $.Site.Params.lightgallery.licenseKey }} -{{ else }} - {{ $lightGalleryLicenseKey = "0000-0000-000-0000" }} -{{- end -}} - -{{- $lightgallery := resources.Get "/libs/lightgallery/lightgallery.min.js" | resources.Fingerprint -}} -{{- $lgFullscreen := resources.Get "/libs/lightgallery/plugins/fullscreen/lg-fullscreen.min.js" | resources.Fingerprint -}} -{{- $lgMediumZoom := resources.Get "/libs/lightgallery/plugins/mediumZoom/lg-medium-zoom.min.js" | resources.Fingerprint -}} -{{- $lgThumbnail := resources.Get "/libs/lightgallery/plugins/thumbnail/lg-thumbnail.min.js" | resources.Fingerprint -}} -{{- $lgVideo := resources.Get "/libs/lightgallery/plugins/video/lg-video.min.js" | resources.Fingerprint -}} -{{- $lgPager := resources.Get "/libs/lightgallery/plugins/pager/lg-pager.min.js" | resources.Fingerprint -}} -{{- $lgHash := resources.Get "/libs/lightgallery/plugins/hash/lg-hash.min.js" | resources.Fingerprint -}} -{{- $swiper := resources.Get "/libs/swiper/swiper-bundle.min.js" | resources.Fingerprint -}} -{{- $masonry := resources.Get "/libs/masonry/masonry.pkgd.min.js" | resources.Fingerprint -}} -{{- $imagesloaded := resources.Get "/libs/masonry/imagesloaded.pkgd.min.js" | resources.Fingerprint -}} -{{- $init := resources.Get "/js/init.js" | resources.Fingerprint -}} - - - - - - - - - - - - - -{{- partialCached "shared/ga.html" . -}} \ No newline at end of file diff --git a/layouts/partials/shared/links-to-translations.html b/layouts/partials/shared/links-to-translations.html deleted file mode 100644 index f51a65d..0000000 --- a/layouts/partials/shared/links-to-translations.html +++ /dev/null @@ -1,7 +0,0 @@ -{{- if .Page.IsTranslated -}} - -{{- end -}} diff --git a/layouts/partials/shared/logo-and-navigation.html b/layouts/partials/shared/logo-and-navigation.html deleted file mode 100644 index 5aeb655..0000000 --- a/layouts/partials/shared/logo-and-navigation.html +++ /dev/null @@ -1,19 +0,0 @@ - \ No newline at end of file diff --git a/layouts/partials/shared/opengraph.html b/layouts/partials/shared/opengraph.html deleted file mode 100644 index d1f119c..0000000 --- a/layouts/partials/shared/opengraph.html +++ /dev/null @@ -1,61 +0,0 @@ -{{- $defaultDescription := "" -}} -{{- with .Description -}} - {{- $defaultDescription = . -}} -{{- else -}} - {{- if .IsPage -}} - {{- $defaultDescription = .Summary -}} - {{- else -}} - {{- with .Site.Params.description -}} - {{- $defaultDescription = . -}} - {{- end -}} - {{- end -}} -{{- end -}} -{{- if or (eq .Page.Type "gallery") (eq .Page.Type "story") -}} - {{- $defaultDescription = .Title -}} -{{- end -}} - - - - - -{{- $images := partial "partials/_funcs/get-page-images" . -}} -{{- range first 6 $images -}} - -{{- end -}} - -{{- if .IsPage }} -{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} - -{{ with .PublishDate }}{{ end }} -{{ with .Lastmod }}{{ end }} -{{- end -}} - -{{- with .Params.audio }}{{ end }} -{{- with .Params.locale }}{{ end }} -{{- with .Site.Params.title }}{{ end }} -{{- with .Params.videos }}{{- range . }} - -{{ end }}{{ end }} - -{{- /* If it is part of a series, link to related articles */}} -{{- $permalink := .Permalink }} -{{- $siteSeries := .Site.Taxonomies.series }} -{{- if $siteSeries }} -{{ with .Params.series }}{{- range $name := . }} -{{- $series := index $siteSeries ($name | urlize) }} -{{- range $page := first 6 $series.Pages }} -{{- if ne $page.Permalink $permalink }}{{ end }} -{{- end }} -{{ end }}{{ end }} -{{- end }} - -{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} -{{- $facebookAdmin := "" }} -{{- with site.Params.social }} -{{- if reflect.IsMap . }} -{{- $facebookAdmin = .facebook_admin }} -{{- end }} -{{- end }} - -{{- /* Facebook Page Admin ID for Domain Insights */}} -{{ with $facebookAdmin }}{{ end }} diff --git a/layouts/partials/shared/photomosaic-data.html b/layouts/partials/shared/photomosaic-data.html deleted file mode 100644 index 23db06a..0000000 --- a/layouts/partials/shared/photomosaic-data.html +++ /dev/null @@ -1,50 +0,0 @@ -{{- $photos := slice -}} -{{- $dirs := slice -}} -{{- $photoDescriptions := dict -}} -{{- $allowedExtentions := ".jpg .jpeg .gif .tiff .webp .svg .eps .ai .xcf .png" -}} - -{{- if fileExists "/content/gallery" -}} - {{- range readDir "/content/gallery" -}} - {{- $dirs = $dirs | append (printf "%s/%s" "/content/gallery" .Name) -}} - {{- end -}} -{{- end -}} - -{{- if fileExists "/content/story" -}} - {{- range readDir "/content/story" -}} - {{- $dirs = $dirs | append (printf "%s/%s" "/content/story" .Name) -}} - {{- end -}} -{{- end -}} - -{{- range $dir := $dirs -}} - {{- $galleries := readDir $dir -}} - {{- range $galleries -}} - {{- $galleryPath := printf "%s/%s" $dir .Name -}} - {{- $galleryContentPath := printf "%s/%s" (replace $dir "/content" "") .Name -}} - - {{- $gallery := $.Site.GetPage $galleryContentPath -}} - {{- $galleryPath := $gallery.RelPermalink -}} - {{- $galleryTitle := $gallery.Title -}} - - {{- $descriptions := dict -}} - - {{- $lines := split $gallery.RawContent "\n" -}} - {{- range $lines -}} - {{- $descr := split . ";" -}} - {{- if strings.Contains (index $descr 0) ":" -}} - {{- $imgVideo := split (index $descr 0) ":" -}} - {{- $descriptions = merge $descriptions (dict (index $imgVideo 0) (index $descr 1)) -}} - {{- else -}} - {{- $descriptions = merge $descriptions (dict (index $descr 0) (index $descr 1)) -}} - {{- end -}} - {{- end -}} - - {{- range $gallery.Resources.ByType "image" -}} - {{- $photos = $photos | append . -}} - {{/* $photoDescriptions is a map of type String => (File, String, String) */}} - {{/* where key is a file name, value is a tuple of (image, file description, gallery path, gallery title) */}} - {{- $photoDescriptions = merge $photoDescriptions (dict .Name (slice . (index $descriptions .Name ) $galleryPath $galleryTitle )) -}} - {{- end -}} - {{- end -}} -{{- end -}} - -{{- return $photoDescriptions -}} diff --git a/layouts/partials/shared/photomosaic-impl.html b/layouts/partials/shared/photomosaic-impl.html deleted file mode 100644 index 881e547..0000000 --- a/layouts/partials/shared/photomosaic-impl.html +++ /dev/null @@ -1,37 +0,0 @@ - {{- $photomosiacData := (partialCached "partials/shared/photomosaic-data.html" . ) -}} - {{- $randomPhotos := slice -}} - {{- range $index, $unused := $photomosiacData -}} - {{- $randomPhotos = $randomPhotos | append $index -}} - {{- end -}} - - {{- $randomPhotos = shuffle $randomPhotos -}} - {{- $randomPhotos = first 31 $randomPhotos -}} - -
- {{- range $randomPhotos -}} - {{- $randomPhoto := index $photomosiacData . -}} - {{- $photo := index $randomPhoto 0 -}} - {{- $descr := index $randomPhoto 1 -}} - {{- $galleryPath := index $randomPhoto 2 -}} - {{- $galleryTitle := index $randomPhoto 3 -}} - {{- $text := printf "%s. %s" $galleryTitle $descr -}} - {{- $thumb := $photo.Fill "200x150 q100" -}} - {{- with $photo.Exif -}} - {{- if eq 6 .Tags.Orientation -}} - {{- $thumb = $photo.Fill "200x150 q100 r270" -}} - {{- else if eq 8 .Tags.Orientation -}} - {{- $thumb = $photo.Fill "200x150 q100 r90" -}} - {{- else if eq 3 .Tags.Orientation -}} - {{- $thumb = $photo.Fill "200x150 q100 r180" -}} - {{- end -}} - {{- end -}} - - -
-
- {{ $text }} -
-
-
- {{- end -}} -
diff --git a/layouts/partials/shared/photomosaic.html b/layouts/partials/shared/photomosaic.html deleted file mode 100644 index d6567ca..0000000 --- a/layouts/partials/shared/photomosaic.html +++ /dev/null @@ -1,18 +0,0 @@ -
-
-
- {{- if (eq .Page.Kind "term") -}} -

{{ i18n "blog" }} #{{- .Data.Term -}}

- {{ else if and (eq .Page.Kind "section") (eq .Page.Type "gallery") -}} -

{{ i18n "photogalleries" }}

- {{ else if and (eq .Page.Kind "section") (eq .Page.Type "story") -}} -

{{ i18n "stories" }}

- {{- end -}} -
-
- - {{- $seq := seq .Site.Params.photomosaic.numberOfUniqueMosaics -}} - {{- $seq = shuffle $seq -}} - {{- $cacheId := first 1 $seq -}} - {{- partialCached "partials/shared/photomosaic-impl.html" . $cacheId -}} -
\ No newline at end of file diff --git a/layouts/partials/shared/post-title-image-or-gallery.html b/layouts/partials/shared/post-title-image-or-gallery.html deleted file mode 100644 index c903b79..0000000 --- a/layouts/partials/shared/post-title-image-or-gallery.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ $titleGallery := .Page.Params.title_gallery }} -{{ if $titleGallery }} - {{ partial "embedded-gallery-partial.html" . $titleGallery }} -{{ else }} - {{ $images := .Resources.ByType "image" }} - {{ with $image := ($images.GetMatch "*cover*") }} -
- {{ .Title }} -
- {{ end }} -{{ end }} \ No newline at end of file diff --git a/layouts/partials/shared/tags.html b/layouts/partials/shared/tags.html deleted file mode 100644 index efd79f2..0000000 --- a/layouts/partials/shared/tags.html +++ /dev/null @@ -1,10 +0,0 @@ -{{- with .GetTerms "tags" -}} -{{- $size := . | len -}} - {{- if gt $size 0 -}} - - {{- end -}} -{{- end -}} \ No newline at end of file