-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for
breadcrumbs
param in front matter for showing…
…/hiding breadcrumbs on specific pages (#367) * feat: add support for `hideBreadcrumbs` front-matter param * docs(en): add some docs about breadcrumb nav, including new hideBreadcrumbs param * fix: fix typo in hideBreadcrumbs param check in breadcrumbs.html partial * docs(en): tidy up the Breadcrumb Navigation documentation * fix: rework hideBreadcrumbs param to breadcrumbs; update docs accordingly * fix: use relpermalink in breadcrumb --------- Co-authored-by: Xin <[email protected]>
- Loading branch information
Showing
2 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
<div class="hx-mt-1.5 hx-flex hx-items-center hx-gap-1 hx-overflow-hidden hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 contrast-more:hx-text-current"> | ||
{{- range .Ancestors.Reverse }} | ||
{{- if not .IsHome }} | ||
<div class="hx-whitespace-nowrap hx-transition-colors hx-min-w-[24px] hx-overflow-hidden hx-text-ellipsis hover:hx-text-gray-900 dark:hover:hx-text-gray-100"> | ||
<a href="{{ .Permalink }}">{{- partial "utils/title" . -}}</a> | ||
</div> | ||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-w-3.5 hx-shrink-0 rtl:-hx-rotate-180\"") -}} | ||
{{- if (default true .Params.breadcrumbs) }} | ||
<div class="hx-mt-1.5 hx-flex hx-items-center hx-gap-1 hx-overflow-hidden hx-text-sm hx-text-gray-500 dark:hx-text-gray-400 contrast-more:hx-text-current"> | ||
{{- range .Ancestors.Reverse }} | ||
{{- if not .IsHome }} | ||
<div class="hx-whitespace-nowrap hx-transition-colors hx-min-w-[24px] hx-overflow-hidden hx-text-ellipsis hover:hx-text-gray-900 dark:hover:hx-text-gray-100"> | ||
<a href="{{ .RelPermalink }}">{{- partial "utils/title" . -}}</a> | ||
</div> | ||
{{- partial "utils/icon.html" (dict "name" "chevron-right" "attributes" "class=\"hx-w-3.5 hx-shrink-0 rtl:-hx-rotate-180\"") -}} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} | ||
<div class="hx-whitespace-nowrap hx-transition-colors hx-font-medium hx-text-gray-700 contrast-more:hx-font-bold contrast-more:hx-text-current dark:hx-text-gray-100 contrast-more:dark:hx-text-current"> | ||
{{- partial "utils/title" . -}} | ||
<div class="hx-whitespace-nowrap hx-transition-colors hx-font-medium hx-text-gray-700 contrast-more:hx-font-bold contrast-more:hx-text-current dark:hx-text-gray-100 contrast-more:dark:hx-text-current"> | ||
{{- partial "utils/title" . -}} | ||
</div> | ||
</div> | ||
</div> | ||
{{ end -}} |