diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bb53c5d..5571dcd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Changed +- ⚠️ Footer configuration parameters are now in their own `footer` sub-group - Search will now return results for all page types, including lists and taxonomies - Comments partials are now better considered within the page layout - Reduced whitespace at the top of the main content block ([#226](https://github.com/jpanther/congo/discussions/226)) diff --git a/config/_default/params.toml b/config/_default/params.toml index fea478ea..1f9bcf8a 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -8,10 +8,6 @@ colorScheme = "congo" defaultAppearance = "light" # valid options: light or dark autoSwitchAppearance = true -showAppearanceSwitcher = false -showCopyright = true -showThemeAttribution = true -showScrollToTop = true enableSearch = false enableCodeCopy = false @@ -19,6 +15,12 @@ enableCodeCopy = false # mainSections = ["section1", "section2"] # robots = "" +[footer] + showCopyright = true + showThemeAttribution = true + showAppearanceSwitcher = false + showScrollToTop = true + [homepage] layout = "page" # valid options: page, profile, custom showRecent = false diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index f19be023..5ce3dc2b 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -8,10 +8,6 @@ colorScheme = "congo" defaultAppearance = "light" # valid options: light or dark autoSwitchAppearance = true -showAppearanceSwitcher = true -showCopyright = true -showThemeAttribution = true -showScrollToTop = true enableSearch = true enableCodeCopy = true @@ -19,6 +15,12 @@ enableCodeCopy = true mainSections = ["samples"] # robots = "" +[footer] + showCopyright = true + showThemeAttribution = true + showAppearanceSwitcher = true + showScrollToTop = true + [homepage] layout = "custom" # valid options: page, profile, custom showRecent = true diff --git a/exampleSite/content/docs/configuration.md b/exampleSite/content/docs/configuration.md index 183b8721..a692026d 100644 --- a/exampleSite/content/docs/configuration.md +++ b/exampleSite/content/docs/configuration.md @@ -116,15 +116,15 @@ Many of the article defaults here can be overridden on a per article basis by sp |`colorScheme`|`"congo"`|The theme colour scheme to use. Valid values are `congo` (default), `avocado`, `ocean`, `fire` and `slate`. Refer to the [Colour Schemes]({{< ref "getting-started#colour-schemes" >}}) section for more details.| |`defaultAppearance`|`"light"`|The default theme appearance, either `light` or `dark`.| |`autoSwitchAppearance`|`true`|Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`.| -|`showAppearanceSwitcher`|`false`|Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference.| -|`showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).| -|`showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).| -|`showScrollToTop`|`true`|When set to `true` the scroll to top arrow is displayed.| |`enableSearch`|`false`|Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly.| |`enableCodeCopy`|`false`|Whether copy-to-clipboard buttons are enabled for `` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below.| |`logo`|_Not set_|The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions.| |`mainSections`|_Not set_|The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used.| |`robots`|_Not set_|String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values.| +|`footer.showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).| +|`footer.showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).| +|`footer.showAppearanceSwitcher`|`false`|Whether or not to show the appearance switcher in the site footer. The browser's local storage is used to persist the visitor's preference.| +|`footer.showScrollToTop`|`true`|When set to `true` the scroll to top arrow is displayed.| |`homepage.layout`|`"page"`|The layout of the homepage. Valid values are `page`, `profile` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/home/custom.html` file. Refer to the [Homepage Layout]({{< ref "homepage-layout" >}}) section for more details.| |`homepage.showRecent`|`false`|Whether or not to display the recent articles list on the homepage.| |`article.showDate`|`true`|Whether or not article dates are displayed.| diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9c4d0e38..3e80305f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -28,8 +28,8 @@ {{- partial "header.html" . -}}
- {{- block "main" . }}{{- end }} - {{ if and (.Site.Params.showScrollToTop | default true) (gt .WordCount 200) }} + {{ block "main" . }}{{ end }} + {{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 200) }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f4cf8343..2103e34a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -21,7 +21,7 @@
{{/* Copyright */}} - {{ if .Site.Params.showCopyright | default true }} + {{ if .Site.Params.footer.showCopyright | default true }}

{{- with .Site.Params.copyright }} {{ . | emojify | markdownify }} @@ -33,7 +33,7 @@

{{ end }} {{/* Theme attribution */}} - {{ if .Site.Params.showThemeAttribution | default true }} + {{ if .Site.Params.footer.showThemeAttribution | default true }}

{{ $hugo := printf `Hugo` @@ -44,9 +44,9 @@ {{ end }}

{{/* Appearance switch */}} - {{ if .Site.Params.showAppearanceSwitcher | default false }} + {{ if .Site.Params.footer.showAppearanceSwitcher | default false }}