From 00f1ca6856940153b37f18b0bff5a733b2aeae3b Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Fri, 11 Sep 2020 16:31:22 +0800 Subject: [PATCH] Add the titleSeparator parameter. (#448) * Add the titleSeparator parameter * Add a description for the titleSeparator parameter --- exampleSite/config.toml | 1 + exampleSite/content/basics/configuration/_index.en.md | 2 ++ layouts/partials/header.html | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9fa84e128f..bea553bc34 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -15,6 +15,7 @@ defaultContentLanguageInSubdir= true showVisitedLinks = true disableBreadcrumb = false disableNextPrev = false + titleSeparator = "::" [outputs] home = [ "HTML", "RSS", "JSON"] diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md index cdf6075a7e..6dbce18c65 100644 --- a/exampleSite/content/basics/configuration/_index.en.md +++ b/exampleSite/content/basics/configuration/_index.en.md @@ -43,6 +43,8 @@ Note that some of these parameters are explained in details in other sections of themeVariant = "" # Provide a list of custom css files to load relative from the `static/` folder in the site root. custom_css = ["css/foo.css", "css/bar.css"] + # Change the title separator. Default to "::". + titleSeparator = "-" ``` ## Activate search diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 6b23395374..2f97f76d83 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,7 +6,7 @@ {{ hugo.Generator }} {{ partial "meta.html" . }} {{ partial "favicon.html" . }} - {{ .Title }} :: {{ .Site.Title }} + {{ .Title }} {{ default "::" .Site.Params.titleSeparator }} {{ .Site.Title }} {{ $assetBusting := not .Site.Params.disableAssetsBusting }}