-
Notifications
You must be signed in to change notification settings - Fork 142
Article pages Table of Contents feature #32
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
Open
HesitantlyHuman
wants to merge
25
commits into
markhorn-dev:main
Choose a base branch
from
HesitantlyHuman:feature/table-of-contents
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Article pages Table of Contents feature #32
HesitantlyHuman
wants to merge
25
commits into
markhorn-dev:main
from
HesitantlyHuman:feature/table-of-contents
Conversation
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
…rather than hanging to the side because of the TOC
…ize DOM searching and manipulation clientside, update button to copy on mouseup and loose focus on mouseleave
…ment, move TOC to be adjacent to content, revert layouts to old layouts, remove unnecessary content margins, begin TOC tracking implementation, add support for TOC-less article pages
…ssing typing to TOC components, update TOC hiding styling
…ine clamping to TOC links, fix nav sizing issues, add testing blog post
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Hi! I'm back again with another feature.
I've implemented a table of contents for the article pages, and figured I'd throw another quick PR, since that is listed on the roadmap.
Features and Changes
Known Issues
Because we are using
remark-sectionize
to wrap our content sections (so that we are able to track our current location in the article)client:load
components with inline mdx imports will throw errors, since they are not able to properly locate the import. The simple fix is to do the import at the top of the mdx file, before any markdown headers. While I am personally fine with this fix, I know that this may be inconvenient for some.Screenshots
Here are some quick screenshots so that you can see how the TOC looks and functions.
Here is how it looks on hover
If there are no headers, we allow the article to take the full width of the page
Simple example without nesting
Blog post 4 with
nav_depth: 3
has a very long TOC. Here is it following your current position, with the fades