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

feat(website): add autolink headings back #1074

Merged
merged 3 commits into from
Dec 6, 2023
Merged

feat(website): add autolink headings back #1074

merged 3 commits into from
Dec 6, 2023

Conversation

yanthomasdev
Copy link
Contributor

Summary

This PR adds back the autolink headings that were lost in the Rome -> Biome migration.

Credits to Astro Docs where I respectfully stole this code from 😛

Test Plan

When you hover over a heading, you will now see a new icon that will link to the current heading. This works both in desktop and mobile since the icon will be moved to the most appropriate place according to the viewport.

Notes:

  • I added two new small dev dependencies to accomplish this: hastscript & html-escaper.
  • This will also apply to blog post entries, where we don't have a table of contents, so that's an extra nicety.
  • I've removed some (supposedly) unused code from the astro.config.mjs file - If necessary I can add it back.

Example:

Mobile viewport
image

Medium-sized viewport (+ hover style example)
image

Large viewport
image

Copy link

netlify bot commented Dec 6, 2023

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit d556f7b
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/657041480d27cf0008428c47
😎 Deploy Preview https://deploy-preview-1074--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the A-Website Area: website label Dec 6, 2023
@ematipico
Copy link
Member

That's nice! I meant to do it but you anticipated me 😹

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Looks good ! I'll take care of formatting :)

@ematipico ematipico merged commit 6db0fc5 into biomejs:main Dec 6, 2023
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Website Area: website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants