Skip to content

Commit 4fe7785

Browse files
Remove rehype-autolink-headings and related styles.
Astro added anchor links, so the plugin was creating duplicate anchors. Eliminated the `rehype-autolink-headings` package from dependencies and updated the code to remove its usage in `astro.config.mjs`.
1 parent 6e52c89 commit 4fe7785

3 files changed

Lines changed: 2 additions & 36 deletions

File tree

astro.config.mjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,6 @@ export default defineConfig({
195195
},
196196
},
197197
],
198-
rehypeHeadingIds,
199-
[
200-
rehypeAutolinkHeadings,
201-
{
202-
// Wrap the heading text in a link.
203-
behavior: "wrap",
204-
},
205-
],
206198
],
207199
},
208200
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"jsdom": "^26.0.0",
3636
"patch-package": "^8.0.0",
3737
"react": "^19.0.0",
38-
"rehype-autolink-headings": "^7.1.0",
3938
"satori": "^0.12.1",
4039
"sharp": "^0.34.1",
4140
"starlight-auto-sidebar": "^0.1.1",

src/styles/custom.css

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,17 @@
3636
}
3737

3838
/* Style the Markdown heading links. */
39-
.sl-markdown-content :is(h1, h2, h3, h4, h5, h6) > a {
39+
.sl-heading-wrapper {
4040
color: var(--sl-color-white);
4141
text-decoration: none;
4242
position: relative;
43-
display: block;
4443
padding-right: 1em;
4544
padding-bottom: 0.25em;
4645
border-bottom: 1px solid var(--sl-color-hairline);
47-
48-
&::after {
49-
content: "";
50-
color: var(--sl-color-white);
51-
background-image: url("/src/assets/chain-dark.svg");
52-
background-size: .5em .5em;
53-
background-repeat: no-repeat;
54-
position: absolute;
55-
right: 0;
56-
top: 33%;
57-
width: .75em;
58-
height: 1em;
59-
opacity: 0.3;
60-
transition: opacity 0.2s ease;
61-
vertical-align: text-bottom;
62-
}
63-
64-
&:hover::after {
65-
opacity: 1;
66-
}
46+
display: block;
6747
}
6848

6949
:root[data-theme='light'] {
70-
.sl-markdown-content :is(h1, h2, h3, h4, h5, h6) > a {
71-
&::after {
72-
background-image: url("/src/assets/chain-light.svg");
73-
}
74-
}
7550
.mermaid {
7651
background: var(--sl-color-gray-7);
7752
}

0 commit comments

Comments
 (0)