From 75855b2758210c985851119f4218012e5520be72 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 29 Jan 2021 23:37:07 +0530 Subject: [PATCH] init feat Breadcrumb Navigation (#207) * adds Breadcrumb nav above title of single page/post * add enabler var 'ShowBreadCrumbs' * introduce i18n var "home" usage: in site config: Params: ShowBreadCrumbs: true in page front-matter: ShowBreadCrumbs: false --- assets/css/post-single.css | 7 ++++++- i18n/en.yaml | 3 +++ layouts/_default/single.html | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/assets/css/post-single.css b/assets/css/post-single.css index 017a3e9..7621468 100644 --- a/assets/css/post-single.css +++ b/assets/css/post-single.css @@ -12,7 +12,8 @@ margin-bottom: 5px; } -.post-meta { +.post-meta, +.breadcrumbs { color: var(--secondary); font-size: 14px; display: flex; @@ -26,6 +27,10 @@ box-shadow: 0 1px 0 var(--secondary) } +.breadcrumbs a { + font-size: 16px; +} + .post-content { color: var(--content) } diff --git a/i18n/en.yaml b/i18n/en.yaml index 14b37b5..b7323d0 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -14,3 +14,6 @@ - id: translations translation: "Translations" + +- id: home + translation: "Home" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 55eb38d..9716ad1 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,6 +2,24 @@
+ {{- if (.Param "ShowBreadCrumbs")}} + + {{- end }}

{{ .Title }} {{- if .Draft }}
  [draft]
{{- end }}