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

anchor tracking implementation #366

Merged
merged 2 commits into from
Nov 28, 2021
Merged

anchor tracking implementation #366

merged 2 commits into from
Nov 28, 2021

Conversation

eyllanesc
Copy link
Contributor

@eyllanesc eyllanesc commented Nov 28, 2021

  • Implement anchor tracking: When navigating using the scrollbar then the url is updated based on the toc.
  • Fix that a toc element is active if the bottom header is above the content div.

In the following images it is shown in the urlbar that changes while the scrollbar is scrolling and coincides with the active item of the toc. Also there is only active item if the bottom of the header is on the content div.

Screenshot_20211128_011758

Screenshot_20211128_011812

Screenshot_20211128_011833

@vercel
Copy link

vercel bot commented Nov 28, 2021

Someone is attempting to deploy a commit to a Personal Account owned by @HEIGE-PCloud on Vercel.

@HEIGE-PCloud first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 28, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pcloud/do-it/Af2K6vq1cQmPyW7kGL4SsQH152D2
✅ Preview: https://do-it-git-fork-eyllanesc-anchor-tracking-pcloud.vercel.app

Copy link
Owner

@HEIGE-PCloud HEIGE-PCloud left a comment

Choose a reason for hiding this comment

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

http://localhost:1313/basic-markdown-syntax/

image

When there is content before the first title of a post and the bottom of the header is on that piece of content, the last item in toc is activated.

@eyllanesc
Copy link
Contributor Author

http://localhost:1313/basic-markdown-syntax/

image

When there is content before the first title of a post and the bottom of the header is on that piece of content, the last item in toc is activated.

Okay, it seems that my calculations assume that the space before the first toc anchor is small so it fails in the post you indicate, later I fix it and upload the patch.

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.

2 participants