Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anchors to headings in default theme posts #48

Open
jacobobryant opened this issue Jul 19, 2022 · 0 comments
Open

Add anchors to headings in default theme posts #48

jacobobryant opened this issue Jul 19, 2022 · 0 comments

Comments

@jacobobryant
Copy link
Owner

e.g. if the post content includes <h2>Foo bar</h2>, we want to transform it to <h2 id="foo-bar">Foo bar</h2>. Maybe even add one of those fancy copy-to-clipboard icons that appear on hover, like GitHub does:

image

markdown-to-html libraries often have a feature for this, but since we start with html, we'll need an html parser. In Clojure it would be pretty easy to use hickory + postwalk to replace any h1-6 nodes. However with babashka looks like we'll need to use pods? I've never used pods myself yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant