From 99a5a284295576a9e0796550753863d61dd3fbb3 Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Fri, 5 Jan 2024 23:52:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20the=20hb.heading=5Fsign.symbol=20?= =?UTF-8?q?parameter,=20default=20to=20=C2=A7=20(#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #110 --- assets/hb/modules/heading-sign/js/index.ts | 4 +++- hugo.toml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/hb/modules/heading-sign/js/index.ts b/assets/hb/modules/heading-sign/js/index.ts index 8049364..bf5d06d 100644 --- a/assets/hb/modules/heading-sign/js/index.ts +++ b/assets/hb/modules/heading-sign/js/index.ts @@ -7,6 +7,8 @@ import * as params from '@params'; return } + const symbol = params?.heading_sign?.symbol ?? '§' + for (const selector in containers) { const container = document.querySelector(selector) if (!container) { @@ -21,7 +23,7 @@ import * as params from '@params'; const anchor = document.createElement('a') anchor.className = 'anchor ms-1' anchor.href = `#${id}` - anchor.innerText = '§' + anchor.innerText = symbol heading.appendChild(anchor) }) } diff --git a/hugo.toml b/hugo.toml index cd435b6..433b917 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,2 +1,5 @@ [[module.imports]] path = "github.com/hbstack/hb" + +[params.hb.heading_sign] +symbol = "§"