diff --git a/hugo.toml b/hugo.toml index 5500f09e..cef4342e 100644 --- a/hugo.toml +++ b/hugo.toml @@ -329,6 +329,8 @@ enableEmoji = true enablePWA = false # FixIt 0.2.14 | NEW whether to add external Icon for external links automatically externalIcon = false + # FixIt 0.3.13 | NEW whether to capitalize titles + capitalizeTitles = true # FixIt 0.3.0 | NEW whether to add site title to the title of every page # remember to set up your site title in `hugo.toml` (e.g. title = "title") withSiteTitle = true @@ -441,7 +443,7 @@ enableEmoji = true showHome = false # FixIt 0.3.13 | NEW separator = "/" - capitalize = false + capitalize = true # FixIt 0.3.10 | NEW Post navigation config [params.navigation] diff --git a/layouts/_default/home.archives.html b/layouts/_default/home.archives.html index ca22c484..2ed46905 100644 --- a/layouts/_default/home.archives.html +++ b/layouts/_default/home.archives.html @@ -52,7 +52,7 @@

{{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}} {{- end -}} {{- /* Use the original title after archiving the articles */ -}} - {{- title .Title -}} + {{- cond (.Param "capitalizeTitles") (title .Title) (.Title) -}} {{- .Date | dateFormat ($.Site.Params.archives.dateFormat | default "01-02") -}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 32de378a..19e77294 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,5 +1,5 @@ {{- define "title" -}} - {{- title .Title -}} + {{- cond (.Param "capitalizeTitles") (title .Title) .Title -}} {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}} {{- end -}} @@ -8,7 +8,7 @@
{{- /* Title */ -}} -

{{- title .Title -}}

+

{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}

{{- /* Subtitle */ -}} {{- with $params.subtitle -}}

{{ . }}

{{- end -}} diff --git a/layouts/_default/single.md b/layouts/_default/single.md index f5b6cf19..d8e0310a 100644 --- a/layouts/_default/single.md +++ b/layouts/_default/single.md @@ -1,6 +1,6 @@ {{- $params := partial "function/params.html" -}} {{- $author := .Store.Get "author" -}} -# {{ title .Title }} +# {{ cond (.Param "capitalizeTitles") (title .Title) .Title }} {{ if $params.password -}} _**{{ T "single.encryptedAbstract" }}**_ diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 8abda62d..20f32d43 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -31,7 +31,7 @@

{{- $icon | partial "plugin/icon.html" -}} {{- end -}} {{- end -}} - {{ title .Title }} + {{ cond (.Param "capitalizeTitles") (title .Title) .Title }}

{{- /* Meta */ -}} diff --git a/layouts/page/friends.html b/layouts/page/friends.html index dbbfdb3b..631ee8a4 100644 --- a/layouts/page/friends.html +++ b/layouts/page/friends.html @@ -1,5 +1,5 @@ {{- define "title" -}} - {{- title .Title -}} + {{- cond (.Param "capitalizeTitles") (title .Title) .Title -}} {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}} {{- end -}} @@ -8,7 +8,7 @@
{{- /* Title */ -}} -

{{- title .Title -}}

+

{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}

{{- /* Subtitle */ -}} {{- with $params.subtitle -}}

{{ . }}

{{- end -}}
diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html index c1a5965f..a0360c57 100644 --- a/layouts/partials/breadcrumb.html +++ b/layouts/partials/breadcrumb.html @@ -8,10 +8,11 @@ {{- end -}} {{- $title := "" -}} + {{- $capitalizeTitles := .Param "capitalizeTitles" -}} {{- with .Description -}} {{- $title = . -}} {{- else -}} - {{- $title = title .LinkTitle -}} + {{- $title = cond $capitalizeTitles (title .LinkTitle) .LinkTitle -}} {{- if .IsPage | and .Summary -}} {{- $title = .Summary -}} {{- end -}} @@ -22,14 +23,14 @@ {{- $innerText = T "single.home" -}} {{- else -}} {{- $innerText = (T (add .TranslationKey ".breadcrumbTitle")) | default (lower .LinkTitle | T) | default .LinkTitle -}} - {{- $innerText = cond (.Param "breadcrumb.capitalize") (title $innerText) $innerText -}} + {{- $innerText = cond ((.Param "breadcrumb.capitalize") | and $capitalizeTitles) (title $innerText) $innerText -}} {{- end -}} {{- end -}} {{- $currentText := (T (add .TranslationKey ".breadcrumbTitle")) | default (lower .LinkTitle | T) | default .LinkTitle -}} - {{- $currentText = cond (.Param "breadcrumb.capitalize") (title $currentText) $currentText -}} + {{- $currentText = cond ((.Param "breadcrumb.capitalize") | and (.Param "capitalizeTitles")) (title $currentText) $currentText -}} diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index 5562ab5a..25acae05 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.13-729c2c39" -}} +{{- .Scratch.Set "version" "v0.3.13-53f221b7" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/partials/plugin/share.html b/layouts/partials/plugin/share.html index 02571bb9..d52d589c 100644 --- a/layouts/partials/plugin/share.html +++ b/layouts/partials/plugin/share.html @@ -1,7 +1,7 @@ {{- $share := (partial "function/params.html").share | default dict -}} {{- if $share.enable -}} - {{- $title := title .Title -}} + {{- $title := cond (.Param "capitalizeTitles") (title .Title) .Title -}} {{- /* 001: Twitter */ -}} {{- if $share.Twitter -}} diff --git a/layouts/partials/recently-updated.html b/layouts/partials/recently-updated.html index 7cd16d61..f08c8ab6 100644 --- a/layouts/partials/recently-updated.html +++ b/layouts/partials/recently-updated.html @@ -22,7 +22,7 @@

{{- if eq $repost.enable true -}} {{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}} {{- end -}} - {{- title .LinkTitle -}} + {{- cond (.Param "capitalizeTitles") (title .LinkTitle) .LinkTitle -}} {{- with .Lastmod | dateFormat (.Site.Params.section.dateformat | default "01-02") -}} diff --git a/layouts/partials/single/collection-list.html b/layouts/partials/single/collection-list.html index b06ac570..a23414c7 100644 --- a/layouts/partials/single/collection-list.html +++ b/layouts/partials/single/collection-list.html @@ -19,8 +19,8 @@

{{- end -}} diff --git a/layouts/taxonomy/terms/collections.html b/layouts/taxonomy/terms/collections.html index ba7764e1..6779a128 100644 --- a/layouts/taxonomy/terms/collections.html +++ b/layouts/taxonomy/terms/collections.html @@ -20,7 +20,7 @@

{{- if eq $repost.enable true -}} {{- dict "Class" "fa-solid fa-share fa-fw text-success me-1" | partial "plugin/icon.html" -}} {{- end -}} - {{- title .LinkTitle -}} + {{- cond (.Param "capitalizeTitles") (title .LinkTitle) .LinkTitle -}}

{{- end -}}