Skip to content

Commit

Permalink
Revert "add anchor links to headings" (#305)
Browse files Browse the repository at this point in the history
Reverts #303

For some reason tables are broken.
  • Loading branch information
floatdrop committed Apr 20, 2023
1 parent 5d79f39 commit 4e60398
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 242 deletions.
42 changes: 0 additions & 42 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ import image from "@astrojs/image";
import mdx from "@astrojs/mdx";

import sitemap from "@astrojs/sitemap";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import { h } from 'hastscript';

const AnchorLinkIcon = h(
'svg',
{
width: 16,
height: 16,
version: 1.1,
viewBox: '0 0 16 16',
xlmns: 'http://www.w3.org/2000/svg',
},
h('path', {
fillRule: 'evenodd',
fill: 'currentcolor',
d: 'M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z',
})
);

// https://astro.build/config
export default defineConfig({
Expand All @@ -41,29 +23,5 @@ export default defineConfig({
shikiConfig: {
theme: 'dracula-soft',
},
rehypePlugins: [
[
rehypeAutolinkHeadings,
{
properties: {
class: 'anchorLink',
},
behavior: 'before',
group: ({ tagName }) =>
h(`div.headingWrapper.level-${tagName}.flex.flex-row.items-baseline.prose-a:mr-4`, {
tabIndex: -1,
}),
content: () => [
h(
`span.anchor-icon.align-baseline`,
{
ariaHidden: 'true',
},
AnchorLinkIcon
),
],
},
],
],
},
});

1 comment on commit 4e60398

@vercel
Copy link

@vercel vercel bot commented on 4e60398 Apr 20, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

getbem-github-io – ./

getbem-github-io-getbem.vercel.app
getbem-github-io.vercel.app
getbem-github-io-git-master-getbem.vercel.app

Please sign in to comment.