Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Added anchor links
Browse files Browse the repository at this point in the history
roll committed Mar 27, 2024
1 parent 8b2b123 commit b900f66
Showing 4 changed files with 48 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/styles.css
Original file line number Diff line number Diff line change
@@ -39,3 +39,12 @@ body::-webkit-scrollbar-track {
border-radius: 3px;
background: var(--scrollbar-color);
}

/* Style the Markdown heading links. */
.sl-markdown-content :is(h1, h2, h3, h4, h5, h6) > a {
color: var(--sl-color-white);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
14 changes: 14 additions & 0 deletions astro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { rehypeHeadingIds } from "@astrojs/markdown-remark"
import starlight from "@astrojs/starlight"
import { defineConfig } from "astro/config"
import rehypeAutolinkHeadings from "rehype-autolink-headings"

// https://astro.build/config
export default defineConfig({
@@ -98,4 +100,16 @@ export default defineConfig({
],
}),
],
markdown: {
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
// Wrap the heading text in a link.
behavior: "wrap",
},
],
],
},
})
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
"test": "npm run lint"
},
"devDependencies": {
"@astrojs/markdown-remark": "^4.3.2",
"@apidevtools/json-schema-ref-parser": "^11.5.4",
"@astrojs/starlight": "^0.21.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
@@ -30,6 +31,7 @@
"js-yaml": "^4.1.0",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"rehype-autolink-headings": "^7.1.0",
"typeface-hk-grotesk": "^1.0.0"
}
}
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b900f66

Please sign in to comment.