Skip to content

Commit

Permalink
✨ Add front matter support for showBreadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed May 26, 2022
1 parent 965dc70 commit d427baf
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/docs/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.|
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/simple.html
Original file line number Diff line number Diff line change
@@ -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">
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -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">
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/term.html
Original file line number Diff line number Diff line change
@@ -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>
Expand Down

0 comments on commit d427baf

Please sign in to comment.