From 7e8e2e94319a344593185cd52c4c090c5a1809a6 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Thu, 28 Dec 2023 16:46:55 +0800 Subject: [PATCH] :sparkles: Feat: add param `params.indexWithSubtitle` --- docs | 2 +- hugo.toml | 3 +++ layouts/index.html | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs b/docs index f3e1a05a..4120618e 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit f3e1a05a22ea0e6e2b247416c7e2d16271b69be5 +Subproject commit 4120618e08e64716fd4c07e7cd2c41b976c2d5c8 diff --git a/hugo.toml b/hugo.toml index 3f4b052b..0cfacfe0 100644 --- a/hugo.toml +++ b/hugo.toml @@ -280,6 +280,9 @@ enableEmoji = true withSiteTitle = true # FixIt 0.3.0 | NEW title delimiter when the site title is be added to the title of every page titleDelimiter = "-" + # FixIt 0.3.0 | NEW whether to add site subtitle to the title of index page + # remember to set up your site subtitle by `params.header.subtitle.name` + indexWithSubtitle = false # FixIt 0.2.14 | NEW FixIt will, by default, inject a theme meta tag in the HTML head on the home page only. # You can turn it off, but we would really appreciate if you don’t, as this is a good way to watch FixIt's popularity on the rise. disableThemeInject = false diff --git a/layouts/index.html b/layouts/index.html index a88f43f8..62290ced 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,3 +1,10 @@ +{{- define "title" -}} + {{- .Site.Title -}} + {{- if .Site.Params.indexWithSubtitle | and .Site.Params.header.subtitle.name -}} + {{- printf " - %v" .Site.Params.header.subtitle.name -}} + {{- end -}} +{{- end -}} + {{- define "content" -}} {{- $params := .Scratch.Get "params" -}} {{- $profile := .Site.Params.home.profile -}}