Anchor links for the site's headers which have ID's #2342

merged 6 commits into from May 7, 2014

4 participants

Jekyll member

For every header on the page inside the main content section which has an ID, it is assigned a clickable anchor that appears when the header is hovered over:

screen shot 2014-05-07 at 4 41 42 pm

Fixes #2330

@parkr parkr merged commit 08a87ae into master May 7, 2014

1 check was pending

Details continuous-integration/travis-ci The Travis CI build is in progress
@parkr parkr deleted the anchor-links branch May 7, 2014
@parkr parkr added a commit that referenced this pull request May 7, 2014
@parkr parkr Update history to reflect merge of #2342 [ci skip] edfa1c8


Jekyll member

Now the History’s top h2 is always #section. Every time you add a new header, the old links break.

Remember, the History is broken by design: #1508


Something like #v-202, #v-202-bug-fixes, ... as ID's for the headings should work. Including the version number for the anchors won't break links for every new version.

The links won't look beautiful, but that's not the point, right?

Jekyll member

Honestly not sure how to achieve that without hand-writing the h2's. Want to do the honors, @penibelst? Would be a part of the Rakefile, in the site:history task.


Why is the first div section? I suspect it's because the heading link is all numbers (which an anchor can't start with)? I suspect if you change e.g., 2.0.0 to v2.0.0 Kramdown will do the right thing and generate a proper permalink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment