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

Header anchors to link to specific section #83

Closed
olivierlacan opened this issue Mar 20, 2020 · 5 comments
Closed

Header anchors to link to specific section #83

olivierlacan opened this issue Mar 20, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@olivierlacan
Copy link
Contributor

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.

@olivierlacan olivierlacan added the enhancement New feature or request label Mar 20, 2020
@webmasterkai
Copy link
Contributor

I'll add a redirect for the google doc https://covidtracking.com/best-practices

@olivierlacan
Copy link
Contributor Author

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

@kissane
Copy link
Contributor

kissane commented Mar 29, 2020

Where did this lovely idea end up?

@olivierlacan
Copy link
Contributor Author

@kissane Forgotten a bit by this grueling past week and the churn I worried about on the website front. I'm sort of waiting for the Gatsby stuff to get merged in before attempting to do this since the implementation I had started was heavily dependent on the Markdown parser used by 11ty and its configuration.

@kevee
Copy link
Member

kevee commented Mar 31, 2020

Closing, as markdown has links in gatsbyjs branch

@kevee kevee closed this as completed Mar 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants