From c606e8c96ee5498dcdb9e77672bc79ece4e7c143 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 8 Dec 2023 19:50:03 +0800 Subject: [PATCH] :zap: Perf: use .LinkTitle instead of .Title --- layouts/_default/section.html | 2 +- layouts/_default/summary.html | 2 +- layouts/partials/breadcrumb.html | 4 ++-- layouts/partials/recently-updated.html | 2 +- layouts/partials/single/collection-nav.html | 8 ++++---- layouts/partials/single/footer.html | 10 +++++----- layouts/partials/single/post-included-in.html | 8 ++++---- layouts/taxonomy/list.html | 2 +- layouts/taxonomy/terms/categories.html | 2 +- layouts/taxonomy/terms/collections.html | 2 +- layouts/taxonomy/terms/tags.html | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/layouts/_default/section.html b/layouts/_default/section.html index 07cd0cb1..58f9f4ce 100644 --- a/layouts/_default/section.html +++ b/layouts/_default/section.html @@ -40,7 +40,7 @@

{{ .Key }}

{{- range .Pages -}}
- {{- .Title -}} + {{- .LinkTitle -}} {{- .Date | dateFormat ($.Site.Params.section.dateFormat | default "01-02") -}} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 0970e865..215168b7 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -61,7 +61,7 @@ {{- range $value := . -}} {{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}} {{- with $tag -}} - {{ .Title }} + {{ .LinkTitle }} {{- end -}} {{- end -}} diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html index 8689c159..9a683c2a 100644 --- a/layouts/partials/breadcrumb.html +++ b/layouts/partials/breadcrumb.html @@ -3,10 +3,10 @@ {{- end -}} diff --git a/layouts/partials/recently-updated.html b/layouts/partials/recently-updated.html index de2d70f9..03726eac 100644 --- a/layouts/partials/recently-updated.html +++ b/layouts/partials/recently-updated.html @@ -12,7 +12,7 @@ {{- $hasTitle = true -}} {{- end -}}
- {{- .Title -}} + {{- .LinkTitle -}} {{- with .Lastmod | dateFormat (.Site.Params.section.dateformat | default "01-02") -}} {{- dict "Date" . | T "single.updatedOnDate" -}} diff --git a/layouts/partials/single/collection-nav.html b/layouts/partials/single/collection-nav.html index 9db81248..934128ac 100644 --- a/layouts/partials/single/collection-nav.html +++ b/layouts/partials/single/collection-nav.html @@ -8,21 +8,21 @@ $term.RelPermalink (dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html") (T "collection") - $term.Title + $term.LinkTitle -}}
- {{ dict "Collections" $termLink | T "single.includedIn.collections" | safeHTML }} {{ len $term.Pages }} + {{ dict "Collections" $termLink | T "single.includedIn.collections" | safeHTML }} {{ $term.Pages.Len }}
{{- with $term.Pages.Prev $ -}} - {{- end -}} {{- with $term.Pages.Next $ -}} - diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html index 0d48d604..0c3aee0c 100644 --- a/layouts/partials/single/footer.html +++ b/layouts/partials/single/footer.html @@ -63,7 +63,7 @@ {{- range $value := . -}} {{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}} {{- with $tag -}} - + {{- end -}} {{- end -}} {{- end -}} @@ -75,14 +75,14 @@
{{- with .Prev -}} - {{- end -}} {{ with .Next }} - {{- end -}} diff --git a/layouts/partials/single/post-included-in.html b/layouts/partials/single/post-included-in.html index ee614adb..3183e148 100644 --- a/layouts/partials/single/post-included-in.html +++ b/layouts/partials/single/post-included-in.html @@ -4,9 +4,9 @@ {{- $categories = $categories | append ( printf `` (partial "function/escapeurl.html" $category.RelPermalink) - (printf "%v - %v" (T "category") $category.Title) + (printf "%v - %v" (T "category") $category.LinkTitle) (dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html") - $category.Title + $category.LinkTitle ) -}} {{- end -}} {{- $categoriesStr := delimit $categories " " -}} @@ -17,9 +17,9 @@ {{- $collections = $collections | append ( printf `%v %v` (partial "function/escapeurl.html" $collection.RelPermalink) - (printf "%v - %v" (T "collection") $collection.Title) + (printf "%v - %v" (T "collection") $collection.LinkTitle) (dict "Class" "fa-solid fa-layer-group fa-fw" | partial "plugin/icon.html") - $collection.Title + $collection.LinkTitle ) -}} {{- end -}} {{- $collectionStr := delimit $collections " " -}} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index 1b0d59b1..57c671d2 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -37,7 +37,7 @@

{{ .Key }}

{{- range .Pages -}}
- {{- .Title -}} + {{- .LinkTitle -}} {{- .Date | dateFormat ($.Site.Params.list.dateFormat | default "01-02") -}} diff --git a/layouts/taxonomy/terms/categories.html b/layouts/taxonomy/terms/categories.html index 26f2b436..812bf9e3 100644 --- a/layouts/taxonomy/terms/categories.html +++ b/layouts/taxonomy/terms/categories.html @@ -15,7 +15,7 @@ {{- range first 5 $pages -}} {{- end -}} {{- if gt (len $pages) 5 -}} diff --git a/layouts/taxonomy/terms/collections.html b/layouts/taxonomy/terms/collections.html index df7461c5..64627df9 100644 --- a/layouts/taxonomy/terms/collections.html +++ b/layouts/taxonomy/terms/collections.html @@ -15,7 +15,7 @@ {{- range first 5 $pages -}} {{- end -}} {{- if gt (len $pages) 5 -}} diff --git a/layouts/taxonomy/terms/tags.html b/layouts/taxonomy/terms/tags.html index a0a00842..777842cf 100644 --- a/layouts/taxonomy/terms/tags.html +++ b/layouts/taxonomy/terms/tags.html @@ -11,11 +11,11 @@ {{- range $tags -}} {{- $grade := math.Min (math.Floor (div (sub .Count 1) $baseGrade)) 10 -}} {{- $fontSize := add $minFont (mul $grade $baseFont) -}} - {{ .Page.Title }} {{ .Count }} + {{ .Page.LinkTitle }} {{ .Count }} {{- end -}} {{- else -}} {{- range $.Site.Taxonomies.tags.ByCount -}} - {{ .Page.Title }} {{ .Count }} + {{ .Page.LinkTitle }} {{ .Count }} {{- end -}} {{- end -}}