Add front matter support for `showBreadcrumbs`

pull/206/head
James Panther 2022-05-26 11:43:19 +10:00
parent 965dc707ed
commit d427baf0e1
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
7 changed files with 10 additions and 5 deletions

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]
### Added
- Breadcrumb display can now be can now be specificed in front matter for articles and list pages
## [2.2.1] - 2022-05-25
### Changed

View File

@ -24,6 +24,7 @@ Front matter parameter default values are inherited from the theme's [base confi
|`robots`|_Not set_|String that indicates how robots should handle this article. 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.|
|`sharingLinks`|`article.sharingLinks`|Which sharing links to display at the end of this article. When not provided, or set to `false` no links will be displayed.|
|`showAuthor`|`article.showAuthor`|Whether or not the author box is displayed in the article footer.|
|`showBreadcrumbs`|`article.showBreadcrumbs` or `list.showBreadcrumbs`|Whether the breadcrumbs are displayed in the article or list header.|
|`showDate`|`article.showDate`|Whether or not the article date is displayed. The date is set using the `date` parameter.|
|`showDateUpdated`|`article.showDateUpdated`|Whether or not the date the article was updated is displayed. The date is set using the `lastmod` parameter.|
|`showEdit`|`article.showEdit`|Whether or not the link to edit the article content should be displayed.|

View File

@ -1,7 +1,7 @@
{{ define "main" }}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in .TableOfContents "<ul") }}
<header>
{{ if .Site.Params.list.showBreadcrumbs | default false }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>

View File

@ -1,7 +1,7 @@
{{ define "main" }}
<article class="max-w-full">
<header>
{{ if .Site.Params.article.showBreadcrumbs | default false }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">

View File

@ -1,7 +1,7 @@
{{ define "main" }}
<article>
<header class="max-w-prose">
{{ if .Site.Params.article.showBreadcrumbs | default false }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">

View File

@ -1,6 +1,6 @@
{{ define "main" }}
<header>
{{ if .Site.Params.list.showBreadcrumbs | default false }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>

View File

@ -1,6 +1,6 @@
{{ define "main" }}
<header>
{{ if .Site.Params.list.showBreadcrumbs | default false }}
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>