Skip to content

Commit

Permalink
feat: add the hb.heading_sign.symbol parameter, default to § (#111)
Browse files Browse the repository at this point in the history
Closes #110
  • Loading branch information
razonyang authored Jan 5, 2024
1 parent f7238af commit 99a5a28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/hb/modules/heading-sign/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
})
}
Expand Down
3 changes: 3 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[[module.imports]]
path = "github.com/hbstack/hb"

[params.hb.heading_sign]
symbol = "§"

0 comments on commit 99a5a28

Please sign in to comment.