question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Header anchors to link to specific section

See original GitHub issue

I found myself wanting to link people to the Best Practices doc from the homepage and since the page overflows the default viewport height on most screens I realized it wasn’t easy to link to a specific section based on a header anchor link (which I find extremely useful).

Example:

-<h2>Best Practices for Data Release</h2>
+<h2 id="best-practices-for-data-release">Best Practices for Data Release</h2>

Then anyone can easily link to https://covidtracking.com/#best-practices-for-data-release and get straight to the relevant section. We can also style the headers to display a symbol next the header when hovered so these permalinks are discoverable.

I have a proof of concept that simply adds markdown-it-anchor and replaces the default 11ty Markdown generator so that we can add that plugin and process all headers with it (it adds an anchor wrapping header tags and we can customize which header levels get it).

I’ll post the PR in a bit for discussion if we think this is useful.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
olivierlacancommented, Mar 20, 2020

That’s swell too. Think anchor links are worth it anyway?

0reactions
keveecommented, Mar 31, 2020

Closing, as markdown has links in gatsbyjs branch

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Add an Anchor Link to Jump to a Specific Part of a Page
It's quite simple! Add an id attribute to the anchor element to give a name to the section of the page. The value...
Read more >
Make headings into link targets - Google Developers
To add an anchor to a heading in HTML, add a <section> element with an id attribute. Don't use <a name> . Use...
Read more >
How to Create a Link to Jump to a Specific Part of a Page ...
2. Take the name you've chosen, and insert it into an opening HTML anchor link tag. · 3. Place that complete opening <a>...
Read more >
HTML Anchors: Here's How To Create Links For Fast ...
Learn how to create HTML hyperlinks. This guide covers the anchor element and all of it's attributes.
Read more >
How to link to a specific location on a SharePoint page via ...
Step 1: Format Text as a Heading · Step 2: Generate a link to the Paragraph section · Step 3: Create a link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found