diff --git a/docs/config/_default/params.toml b/docs/config/_default/params.toml index 80c1416f8b..9de91b1672 100644 --- a/docs/config/_default/params.toml +++ b/docs/config/_default/params.toml @@ -401,6 +401,32 @@ boxStyle = [ { identifier = 'magic', i18n = '', title = 'Magic', icon = 'rainbow', color = 'gold' } ] +# Hide the authors name and email addresses +# Default: false +# If the standard content-footer finds author name information, you can +# disable the output of this and the according email address by setting this +# parameter to `true`. +hideAuthorName = false + +# Hide the authors email addresses +# Default: false +# If the standard content-footer finds an authors email address, you can +# disable the output by setting this parameter to `true`. +hideAuthorEmail = false + +# Hide the authoring date +# Default: false +# If the standard content-footer finds an authoring date, you can +# disable the output by setting this parameter to `true`. +hideAuthorDate = false + +# Date format +# Default: ':date_medium' +# The date format used for the date in the standard content-footer, when +# displaying a pages meta information. See https://gohugo.io/functions/time/format/#localization +# for possible values. +dateFormat = ':date_medium' + #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Highlight # These options configure how code is displayed. diff --git a/docs/content/authoring/meta/_index.en.md b/docs/content/authoring/meta/_index.en.md index d57f507c3e..be40f94909 100644 --- a/docs/content/authoring/meta/_index.en.md +++ b/docs/content/authoring/meta/_index.en.md @@ -64,6 +64,8 @@ headingPre = ' ' - `AuthorEmail` if [GitInfo](https://gohugo.io/methods/page/gitinfo/) is active, otherwise `LastModifierEmail` front matter - `AuthorDate` if [GitInfo](https://gohugo.io/methods/page/gitinfo/) is active, otherwise [Hugo's `date` front matter](https://gohugo.io/methods/page/date/) +See how to further [configure this information](configuration/content/meta) on a site-wide basis. + {{< multiconfig fm=true >}} LastModifierDisplayName = 'Santa Claus' LastModifierEmail = 'santa@example.com' diff --git a/docs/content/configuration/content/headings/index.en.md b/docs/content/configuration/content/headings/index.en.md index 1d79e5611c..6dbe288ed0 100644 --- a/docs/content/configuration/content/headings/index.en.md +++ b/docs/content/configuration/content/headings/index.en.md @@ -3,7 +3,7 @@ categories = ["howto"] description = "Configuring heading anchors" options = ["disableAnchorCopy", "disableAnchorScrolling"] title = "Headings" -weight = 3 +weight = 4 +++ Headings can have anchor links that appear when you hover over them. diff --git a/docs/content/configuration/content/headings/index.pir.md b/docs/content/configuration/content/headings/index.pir.md index 1567d71cfb..0378039917 100644 --- a/docs/content/configuration/content/headings/index.pir.md +++ b/docs/content/configuration/content/headings/index.pir.md @@ -3,6 +3,6 @@ categories = ["howto"] description = "Configuring heading anchors" options = ["disableAnchorCopy", "disableAnchorScrolling"] title = "Headings" -weight = 3 +weight = 4 +++ {{< piratify >}} \ No newline at end of file diff --git a/docs/content/configuration/content/hidden/_index.en.md b/docs/content/configuration/content/hidden/_index.en.md index 41657871c6..80bf770a86 100644 --- a/docs/content/configuration/content/hidden/_index.en.md +++ b/docs/content/configuration/content/hidden/_index.en.md @@ -3,7 +3,7 @@ categories = ["explanation", "howto"] description = "Learn about the hidden pages feature" options = ["disableSearchHiddenPages", "disableSeoHiddenPages", "disableTagHiddenPages"] title = "Hidden Pages" -weight = 5 +weight = 6 +++ This theme allows you to [create hidden pages](authoring/meta#hidden). diff --git a/docs/content/configuration/content/hidden/_index.pir.md b/docs/content/configuration/content/hidden/_index.pir.md index 49ae57842f..76f68500ef 100644 --- a/docs/content/configuration/content/hidden/_index.pir.md +++ b/docs/content/configuration/content/hidden/_index.pir.md @@ -3,6 +3,6 @@ categories = ["explanation", "howto"] description = "Learn about the hidden pages feature" options = ["disableSearchHiddenPages", "disableSeoHiddenPages", "disableTagHiddenPages"] title = "Hidden Pages" -weight = 5 +weight = 6 +++ {{< piratify >}} \ No newline at end of file diff --git a/docs/content/configuration/content/linking/index.en.md b/docs/content/configuration/content/linking/index.en.md index 29d06402c6..296a1f2fe1 100644 --- a/docs/content/configuration/content/linking/index.en.md +++ b/docs/content/configuration/content/linking/index.en.md @@ -3,7 +3,7 @@ categories = ["howto"] description = "What options are available for links and images" options = ["disableDefaultRelref", "disableExplicitIndexURLs"] title = "Linking" -weight = 4 +weight = 5 +++ Further [settings are available](authoring/frontmatter/linking) to be used in your configuration or front matter. diff --git a/docs/content/configuration/content/linking/index.pir.md b/docs/content/configuration/content/linking/index.pir.md index 7742d8d769..f33769272f 100644 --- a/docs/content/configuration/content/linking/index.pir.md +++ b/docs/content/configuration/content/linking/index.pir.md @@ -3,6 +3,6 @@ categories = ["howto"] description = "What options are available for links and images" options = ["disableDefaultRelref", "disableExplicitIndexURLs"] title = "Linking" -weight = 4 +weight = 5 +++ {{< piratify >}} \ No newline at end of file diff --git a/docs/content/configuration/content/meta/index.en.md b/docs/content/configuration/content/meta/index.en.md new file mode 100644 index 0000000000..8869081e9b --- /dev/null +++ b/docs/content/configuration/content/meta/index.en.md @@ -0,0 +1,49 @@ ++++ +categories = ["howto"] +description = "Display page meta information with your content" +options = ["dateFormat", "hideAuthorName", "hideAuthorEmail", "hideAuthorDate"] +title = "Page Meta Information" +weight = 3 ++++ + +The theme supports a default display of page meta information in `layouts/partials/content-footer.html`. + +The content footer dynamically pulls information based on the availability of [GitInfo metadata](https://gohugo.io/methods/page/gitinfo/). If Git information is present, it uses the author's name, email, and the date from the Git commit details. This ensures that the displayed information is always up-to-date with the latest modifications. + +In cases where Git information is not available, the theme falls back to `LastModifierDisplayName`, `LastModifierEmail`, and `Date` [defined in the page's front matter](authoring/meta#footer-information). + +## Disable Display of Author's Name + +{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} You can disable the output of an author's name and its according email address by setting this parameter to `true`. + +{{< multiconfig file=hugo >}} +[params] + hideAuthorName = true +{{< /multiconfig >}} + +## Disable Display of Author's Email + +{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} The author's email, when displayed, is presented as a clickable mailto link, providing a convenient way for readers to reach out. You can disable the output of an author's email address by setting this parameter to `true`. + +{{< multiconfig file=hugo >}} +[params] + hideAuthorEmail = true +{{< /multiconfig >}} + +## Disable Display of Authoring Date + +{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} # If the standard content-footer finds an authoring date, you can disable its output by setting this parameter to `true`. + +{{< multiconfig file=hugo >}} +[params] + hideAuthorEmail = true +{{< /multiconfig >}} + +## Adjust the Timestamp Format + +{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} You can overwrite the default date format used when displaying a pages meta information. See [the Hugo docs](https://gohugo.io/functions/time/format/#localization) for possible values. + +{{< multiconfig file=hugo >}} +[params] + dateFormat = ':date_medium' +{{< /multiconfig >}} diff --git a/docs/content/configuration/content/meta/index.pir.md b/docs/content/configuration/content/meta/index.pir.md new file mode 100644 index 0000000000..06471c1edd --- /dev/null +++ b/docs/content/configuration/content/meta/index.pir.md @@ -0,0 +1,8 @@ ++++ +categories = ["howto"] +description = "Display page meta information with your content" +options = ["dateFormat", "hideAuthorName", "hideAuthorEmail", "hideAuthorDate"] +title = "Page Meta Information" +weight = 3 ++++ +{{< piratify >}} \ No newline at end of file diff --git a/docs/content/introduction/releasenotes/7/4.en.md b/docs/content/introduction/releasenotes/7/4.en.md index 12a0fd5067..6e6c33ae4b 100644 --- a/docs/content/introduction/releasenotes/7/4.en.md +++ b/docs/content/introduction/releasenotes/7/4.en.md @@ -48,6 +48,8 @@ weight = -4 This was done to be compatible with adding custom scripts in an older version of the Hugo documentation. +- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} If you haven't overridden `layouts/partials/content-footer.html`, you can now [configure which page meta information](configuration/content/meta) - like author's name, email address and authoring date - should be displayed. Also the date format is now configurable. + - {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} The logo color is now configurable via the `--MENU-HEADER-color` variable in your variant stylesheets. - {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Now favicons are also searched in the `assets/images` directory. diff --git a/layouts/partials/content-footer.html b/layouts/partials/content-footer.html index f73c2cbcf6..a9da49997a 100644 --- a/layouts/partials/content-footer.html +++ b/layouts/partials/content-footer.html @@ -1,25 +1,26 @@ {{- $LastModifierDisplayName := "" }} {{- $LastModifierEmail := "" }} {{- $Date := "" }} +{{- $dateFormat := site.Params.dateFormat | default ":date_medium" }} {{- with .GitInfo }} - {{- with .AuthorName }} + {{- with and (not site.Params.hideAuthorName) .AuthorName }} {{- $LastModifierDisplayName = . }} {{- end }} - {{- with .AuthorEmail }} + {{- with and (not site.Params.hideAuthorEmail) .AuthorEmail }} {{- $LastModifierEmail = . }} {{- end }} - {{- with .AuthorDate }} - {{- $Date = . | time.Format ":date_medium" }} + {{- with and (not site.Params.hideAuthorDate) .AuthorDate }} + {{- $Date = . | time.Format $dateFormat }} {{- end }} {{- else }} - {{- with .Params.LastModifierDisplayName }} + {{- with and (not site.Params.hideAuthorName) .Params.LastModifierDisplayName }} {{- $LastModifierDisplayName = . }} {{- end }} - {{- with .Params.LastModifierEmail }} + {{- with and (not site.Params.hideAuthorEmail) .Params.LastModifierEmail }} {{- $LastModifierEmail = . }} {{- end }} - {{- with .Date }} - {{- $Date = . | time.Format ":date_medium" }} + {{- with and (not site.Params.hideAuthorDate) .Date }} + {{- $Date = . | time.Format $dateFormat }} {{- end }} {{- end }} {{- if $LastModifierDisplayName }} diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index e01796060c..73bfe715a4 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.3.2+648b0d249b63bf77788692ad753f8d4a00e14537 \ No newline at end of file +7.3.2+00590db6bbc0743775238176a01124a654be9887 \ No newline at end of file