Skip to content

Commit 675c2a2

Browse files
committed
add remark-math and katex
1 parent e3c57d2 commit 675c2a2

4 files changed

Lines changed: 149 additions & 6 deletions

File tree

astro.config.mjs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@ import tailwindcss from '@tailwindcss/vite';
44
import mdx from '@astrojs/mdx';
55
import rehypeSlug from 'rehype-slug';
66
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
7-
7+
import remarkMath from 'remark-math';
8+
import rehypeKatex from 'rehype-katex';
89
import sitemap from '@astrojs/sitemap';
910

1011
export default defineConfig({
1112
site: 'https://beparano.id',
1213
output: 'static',
1314
markdown: {
15+
remarkPlugins: [remarkMath],
1416
rehypePlugins: [
1517
rehypeSlug,
1618
[rehypeAutolinkHeadings, {
17-
behavior: 'append',
18-
properties: { class: 'heading-anchor', ariaHidden: 'true', tabIndex: -1 },
19-
content: { type: 'text', value: '#' },
20-
}],
19+
behavior: 'append',
20+
properties: { class: 'heading-anchor', ariaHidden: 'true', tabIndex: -1 },
21+
content: { type: 'text', value: '#' },
22+
}],
23+
rehypeKatex,
2124
],
2225
},
2326
vite: {
2427
plugins: [tailwindcss()],
2528
},
2629
integrations: [mdx(), sitemap()],
27-
});
30+
});

package-lock.json

Lines changed: 137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
"@tailwindcss/vite": "^4.2.4",
2020
"astro": "^6.1.8",
2121
"rehype-autolink-headings": "^7.1.0",
22+
"rehype-katex": "^7.0.1",
2223
"rehype-slug": "^6.0.0",
24+
"remark-math": "^6.0.0",
2325
"tailwindcss": "^4.2.4"
2426
}
2527
}

src/layouts/Base.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const currentPath = Astro.url.pathname;
4343
<link rel="manifest" href="/site.webmanifest" />
4444

4545
<link rel="alternate" type="application/rss+xml" title="beparano.id" href="/rss.xml" />
46+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" />
4647

4748
<!-- Open Graph -->
4849
<meta property="og:title" content={pageTitle} />

0 commit comments

Comments
 (0)