From d947cf46d3452b6de2ee90c3e62fd3c91f6cd656 Mon Sep 17 00:00:00 2001 From: HEIGE-PCloud Date: Mon, 10 Jul 2023 22:23:07 +0100 Subject: [PATCH 1/3] feat: enable view transition --- layouts/_default/summary.html | 2 +- layouts/partials/head/meta.html | 1 + layouts/partials/header.html | 2 +- layouts/partials/plugin/image.html | 3 ++- layouts/posts/single.html | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 1f38c69d2..9126e9aa0 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -23,7 +23,7 @@ {{- with $image -}} {{- end -}} diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html index c188c4836..daa6bf71a 100644 --- a/layouts/partials/head/meta.html +++ b/layouts/partials/head/meta.html @@ -9,6 +9,7 @@ + {{- with .Site.Params.app.tileColor -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 8f9381fe1..9a997253f 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -32,7 +32,7 @@ {{- with .Page -}} {{- $url = .RelPermalink -}} {{- end -}} - + {{- .Pre | safeHTML }} {{ .Name }} {{ .Post | safeHTML -}} {{- end -}} diff --git a/layouts/partials/plugin/image.html b/layouts/partials/plugin/image.html index 1ca3600bb..b1fd4c2ad 100644 --- a/layouts/partials/plugin/image.html +++ b/layouts/partials/plugin/image.html @@ -43,6 +43,7 @@ src="{{ $src | safeURL }}" srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x" sizes="auto" + {{ with .ViewTransitionName }}style="view-transition-name: {{ . | safeCSS }};"{{ end }} alt="{{ $alt }}"{{ with $height }} height="{{ . }}" {{ end }}{{ with $width }} width="{{ . }}" {{ end }}> {{- else -}} @@ -53,5 +54,5 @@ srcset="{{ $small | safeURL }}, {{ $src | safeURL }} 1.5x, {{ $large | safeURL }} 2x" sizes="auto" alt="{{ $alt }}" - title="{{ .Title | default $alt }}"{{ with $height }} height="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}> + title="{{ .Title | default $alt }}"{{ with $height }} height="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}{{ with .ViewTransitionName }}style="view-transition-name: {{ . | safeCSS }};"{{ end }}> {{- end -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 0d03dff5e..38f63b3fe 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -164,7 +164,7 @@

{{ . }}

{{- end -}} {{- with $image -}} {{- end -}} {{- /* Series list */ -}} From a6c4d5fad7564482e6eeda7aae75caec3c0bb401 Mon Sep 17 00:00:00 2001 From: HEIGE-PCloud Date: Mon, 10 Jul 2023 22:37:30 +0100 Subject: [PATCH 2/3] feat: add more view transitions --- layouts/_default/section.html | 2 +- layouts/_default/summary.html | 2 +- layouts/posts/single.html | 4 ++-- layouts/shortcodes/showcase.html | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 186601626..eac3e0eac 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -22,7 +22,7 @@

{{ .Key }}

{{- range .Pages -}}
- + {{- .Title -}} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 9126e9aa0..9cec24ce9 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -23,7 +23,7 @@ {{- with $image -}} {{- end -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 38f63b3fe..fd0cae47a 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -33,7 +33,7 @@

{{ T "contents" }}

{{- /* Title */ -}} -

{{ .Title }}

+

{{ .Title }}

{{- /* Subtitle */ -}} {{- with $params.subtitle -}} @@ -164,7 +164,7 @@

{{ . }}

{{- end -}} {{- with $image -}} {{- end -}} {{- /* Series list */ -}} diff --git a/layouts/shortcodes/showcase.html b/layouts/shortcodes/showcase.html index c3fa88a75..cd3825de1 100644 --- a/layouts/shortcodes/showcase.html +++ b/layouts/shortcodes/showcase.html @@ -23,10 +23,10 @@
-

+

{{ $title }}

From 9c05da4eedd72e0112e915dcbee415f58fd853e0 Mon Sep 17 00:00:00 2001 From: HEIGE-PCloud Date: Thu, 5 Oct 2023 13:12:06 +0100 Subject: [PATCH 3/3] feat: customisable main section Close #1070 --- layouts/index.html | 2 +- layouts/index.rss.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index 8150e328f..d603a9825 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -21,7 +21,7 @@ {{- /* Posts */ -}} {{- if ne $posts.enable false | and .Site.RegularPages -}} {{- /* Paginate */ -}} - {{- $pages := where .Site.RegularPages "Type" "posts" -}} + {{- $pages := where .Site.RegularPages "Type" "in" site.Params.mainSections -}} {{- if .Site.Params.page.hiddenFromHomePage -}} {{- $pages = where $pages "Params.hiddenfromhomepage" false -}} {{- else -}} diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml index 355c26a5b..4bc04b165 100644 --- a/layouts/index.rss.xml +++ b/layouts/index.rss.xml @@ -36,7 +36,7 @@ {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} - {{- range where .Site.RegularPages "Type" "posts" | first (.Site.Params.home.rss | default 10) -}} + {{- range where .Site.RegularPages "Type" "in" site.Params.mainSections | first (.Site.Params.home.rss | default 10) -}} {{- dict "Page" . "Site" .Site | partial "rss/item.html" -}} {{- end -}}