-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Page scrolls past table of contents header anchor points #115
Comments
Thanks for noting. Don't know why the root margin displacement defined in useActiveHash is not working. Will need to analyze further. |
The correct header displacement should be handled by the toc.css style file. I have no clue why it is not coming through correctly. I added the |
izinkan saya menjawab.. 🙏 @styxlab |
@seoxyz Thanks for finding out the root cause of this issue ❤️ I'll add you to the contributors list right away and will think about how to best fix it later this week. |
@all-contributors please add @seoxyz for code |
I've put up a pull request to add @seoxyz! 🎉 |
Thanks @styxlab 🙏 |
The problem is not easily fixed, it turns out to be a side effect of #31. The situation is as follows: Reverting the change of #31 would solve this issue here, but the wide image alignment issue would re-appear. One more note. |
One way to do it might be to modify the <h2 id="my-header">My header</h2> becomes: <div id="my-header" style="position: relative; top: -80px;"></div>
<h2 id="my-header">My header</h2> Works on my browser. |
On a side note, you can bypass the issue from the Ghost editor by adding the div code in a html embed. <div id="my-header" style="position: relative; top: -80px;"></div> However, it requires modifying the content of all your posts/pages. Not ideal. |
Here's a PR #150 to fix this. It patches the html after the page loaded to add divs with the correct |
Thanks @Garfounkel! I will have a look at your suggestions and PRs later this week. (@all-contributors please add @Garfounkel for code). |
I've put up a pull request to add @Garfounkel! 🎉 |
When a link is clicked in the table of contents, the page scrolls to just past the start of the first paragraph rather than to the start of the header.
The text was updated successfully, but these errors were encountered: