feat: add blog reading-time badges and inline table of contents - #136
Merged
Conversation
|
@Peolite1 is attempting to deploy a commit to the truthixify's projects Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Aug 26, 2026
Contributor
|
Merged. Reading-time and the TOC both honour reduced-motion, appreciate that not being an afterthought @Peolite1. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title
feat: add blog reading-time badges and inline table of contents (#123)
Description
This PR implements the features requested in #123, which improve the perceived quality and navigability of the blog. Specifically, it introduces reading-time badges and an auto-generated table of contents for longer posts.
Changes Made
rehype-slugto generate anchor IDs forh2andh3tags in MDX files during the Vite build, andgithub-sluggerfor generating matching hashes in the TOC logic.src/utils/blog.tsto compute reading time (based on 200 words per minute) and extracth2/h3headings from the raw MDX body at build time.Blog.tsx): The reading-time badge (e.g. "6 min read") is now rendered on the blog index cards and the single-post header next to the date and author.BlogToc.tsx): Created a new sticky sidebar component that lists TOC links and usesIntersectionObserverto highlight the currently active section. The TOC only displays on posts over 800 words with at least one heading.htmlscroll-behavior is set tosmoothbut respects@media (prefers-reduced-motion: reduce).aria-label="Table of Contents"for screen readers.Fixes Issue
Closes #123
Acceptance Criteria Verified
prefers-reduced-motionfor smooth-scroll behavior