Skip to content

Conversation

@eXpl0it3r
Copy link
Contributor

@eXpl0it3r eXpl0it3r commented Nov 26, 2025

Closes #123

Using rehype slug & autolink-headings & toc we can automatically add a Table of Contents to every blog post.

I marked this as draft, as I feel like it could use some more work:

  • Make more use of Tailwind CSS instead of custom CSS
  • Reduce the size of the Astro config somehow
  • Fix the syntax issues with rehype-toc (not sure why VS Code marks it as error)

Not sure if/when I have the time to fix this, but the draft PR could also just serve as inspiration for someone else.

Desktop view

image

Responsive "tablet" / mobile view

image

Comment on lines +42 to +49
const convertToUl = (node) => {
if (node.tagName === 'ol') {
node.tagName = 'ul';
}
if (node.children) {
node.children.forEach(convertToUl);
}
return node;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider keeping ol and hiding the numbering via CSS

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

Successfully merging this pull request may close these issues.

Table Of Contents

1 participant