From ed8cf316a52e0ffe44691bd4252d36a144383d83 Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Tue, 1 Oct 2024 14:00:36 +0800
Subject: [PATCH] :sparkles: Feat: add separator and capitalize options for
breadcrumb config
---
assets/css/_core/_breadcrumb.scss | 4 ++--
hugo.toml | 3 +++
layouts/partials/breadcrumb.html | 10 +++++++---
layouts/partials/init/index.html | 2 +-
layouts/partials/plugin/icon.html | 2 +-
layouts/partials/plugin/link.html | 2 +-
layouts/partials/single/collection-list.html | 9 +++++----
7 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/assets/css/_core/_breadcrumb.scss b/assets/css/_core/_breadcrumb.scss
index 58469baa..c8241f0e 100644
--- a/assets/css/_core/_breadcrumb.scss
+++ b/assets/css/_core/_breadcrumb.scss
@@ -30,8 +30,8 @@
.breadcrumb-item {
display: flex;
- +.breadcrumb-item::before {
- content: "/";
+ + .breadcrumb-item::before {
+ content: attr(data-separator);
display: inline-block;
padding-inline: 0.5rem;
color: $global-font-secondary-color;
diff --git a/hugo.toml b/hugo.toml
index 177d1025..e291edad 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -439,6 +439,9 @@ enableEmoji = true
enable = false
sticky = false
showHome = false
+ # FixIt 0.3.13 | NEW
+ separator = "/"
+ capitalize = false
# FixIt 0.3.10 | NEW Post navigation config
[params.navigation]
diff --git a/layouts/partials/breadcrumb.html b/layouts/partials/breadcrumb.html
index effea757..c1a5965f 100644
--- a/layouts/partials/breadcrumb.html
+++ b/layouts/partials/breadcrumb.html
@@ -1,4 +1,5 @@
{{- if (gt (len .Ancestors.Reverse) 1) | and (eq .Site.Params.breadcrumb.enable true) -}}
+ {{- $separator := .Site.Params.breadcrumb.separator | default "/" -}}
{{- end -}}
diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html
index a107a07a..8c2c436c 100644
--- a/layouts/partials/init/index.html
+++ b/layouts/partials/init/index.html
@@ -1,4 +1,4 @@
-{{- .Scratch.Set "version" "v0.3.12" -}}
+{{- .Scratch.Set "version" "v0.3.13-b029036c" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
diff --git a/layouts/partials/plugin/icon.html b/layouts/partials/plugin/icon.html
index f71efa75..a083795c 100644
--- a/layouts/partials/plugin/icon.html
+++ b/layouts/partials/plugin/icon.html
@@ -7,7 +7,7 @@
{{- $src = printf "%v/%v.svg" $prefix . -}}
{{- end -}}
- {{ if not $src }}
+ {{- if not $src -}}
{{- errorf "Icon src is missing" -}}
{{- end -}}
diff --git a/layouts/partials/plugin/link.html b/layouts/partials/plugin/link.html
index 9f01deb9..a9647e53 100644
--- a/layouts/partials/plugin/link.html
+++ b/layouts/partials/plugin/link.html
@@ -29,7 +29,7 @@
{{- end -}}
{{- if
(.ExternalIcon | default false)
- | and $external | and (eq (hasPrefix .Content ``) | or (strings.HasSuffix .Content `):`)) false)
-}}
{{- if .Download -}}
diff --git a/layouts/partials/single/collection-list.html b/layouts/partials/single/collection-list.html
index 66defcb8..b06ac570 100644
--- a/layouts/partials/single/collection-list.html
+++ b/layouts/partials/single/collection-list.html
@@ -18,13 +18,14 @@