From 78c98424bcfeed4ab9511dd8abc37db606f21778 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 6 Feb 2025 10:50:09 +0800 Subject: refactor: replace header with breadcrumbs in some pages Former-commit-id: 4a6d61905444570cceddf00dee8747f432ed7e52 --- assets/css/components/_pages.scss | 15 +++++++++++++++ layouts/_default/single.html | 10 +++++----- layouts/_default/term.html | 17 +++++++++-------- layouts/partials/components/breadcrumbs.html | 15 +++++++++++++++ layouts/section/posts.html | 2 +- 5 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 layouts/partials/components/breadcrumbs.html diff --git a/assets/css/components/_pages.scss b/assets/css/components/_pages.scss index d9ac3efc..1ba9d6e8 100644 --- a/assets/css/components/_pages.scss +++ b/assets/css/components/_pages.scss @@ -289,3 +289,18 @@ section.taxonomy { text-decoration: none; } } + +ol.breadcrumb { + list-style-type: none; + display: flex; + padding-inline-start: 0; + font-family: var(--mono-font-family); + + li { + &:not(:last-child)::after { + content: "/"; + color: var(--secondary-text-color); + margin: 0 0.5rem; + } + } +} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 13a09111..68d7edd5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,10 +1,10 @@ {{ partial "snippets/document-start.html" . }}
- - - + {{ if eq .Type "posts" }} + {{ partial "components/breadcrumbs.html" . }} + {{ else }} + {{ partial "header.html" . }} + {{ end }}
{{ if in .Site.Params.mainSections .Type }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html index c8fa251b..45951666 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -1,13 +1,7 @@ {{ partial "snippets/document-start.html" . }} {{ partial "snippets/document-end.html" . }} diff --git a/layouts/partials/components/breadcrumbs.html b/layouts/partials/components/breadcrumbs.html new file mode 100644 index 00000000..4f569b1b --- /dev/null +++ b/layouts/partials/components/breadcrumbs.html @@ -0,0 +1,15 @@ + diff --git a/layouts/section/posts.html b/layouts/section/posts.html index ebc7d0cd..03668a6d 100644 --- a/layouts/section/posts.html +++ b/layouts/section/posts.html @@ -1,6 +1,6 @@ {{ partial "snippets/document-start.html" . }}
- {{ partial "header.html" . }} + {{ partial "components/breadcrumbs.html" . }}
{{ partial "components/heatmap.html" . }} -- cgit v1.2.3