Closes #24.
Automatically generate Table of Contents for each page #376
Seems pretty straight forward.
@ -189,0 +207,4 @@
margin: var(--sidebar-link-margin);
min-height: var(--sidebar-link-height);
height: auto;
color: var(--lm-sidebar-link-text-color);
--lm stands for light-mode, so in the dark mode these colors will be incorrect. I think it's better to remove the color, background-color and border property instead add the sidebar-link class to the <a> element. As sidebar-link is the class defined by codeberg.css that will contain the correct value as it takes into account the dark and light mode.
@ -18,2 +18,4 @@
"markdown-it-anchor": "^8.6.7",
"pagefind": "^1.0.4"
},
"dependencies": {
Could you run:
$ npm i @uncenter/eleventy-plugin-toc -D
So that this dependency is moved to the dev dependencies.
8acbd9ad31
to 192a7427a7
@Gusted should be good, but since the plugin for generating the TOC is not letting me directly specify a CSS class for the links, I used replace filter from Nunjucks to add the class. Hope that's ok. Otherwise, I could fork it but I don't think adding the burden of maintaining the plugin on me or this repository is wiser than working with what we have.
I used replace filter from Nunjucks to add the class. Hope that's ok. Otherwise, I could fork it but I don't think adding the burden of maintaining the plugin on me or this repository is wiser than working with what we have.
That's fine! No need to fork it, I wasn't aware you couldn't do that trough the current library. I do think the replace should happen in wrapper function, so the replace filter doesn't have to duplicated in the template files. Otherwise the PR looks fine!
192a7427a7
to 823f5e7e53
@Gusted Done :)
@ -189,0 +217,4 @@
}
#toc-side ol:first-child {
border-left: 1px solid rgba(0, 0, 0, 0.15);
This will need to take into account dark mode, as this is not a visible color. I would suggest simply using rgba(255, 255, 255, 0.15) for dark mode.
823f5e7e53
to f81d5a60cb
@n0toose Do you want to add something?
Do you want to add something?
Nope, feel free to merge :)
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?