-
Notifications
You must be signed in to change notification settings - Fork 8
/
astro.config.mjs
79 lines (78 loc) · 2.66 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import astroExpressiveCode from 'astro-expressive-code';
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
// https://astro.build/config
export default defineConfig({
site: 'https://blog.mbedded.ninja', // This enables the sitemap generation
integrations: [
astroExpressiveCode({
// You can optionally override the plugin's default settings here
frames: {
// Prevent filenames from trying to extract filenames from code comments. This caused problems,
// it meant that comments in the first four lines of codes were being interpreted as filenames
// when they were just plain comments
extractFileNameFromCode: false,
removeCommentsWhenCopyingTerminalFrames: false,
},
}),
starlight({
title: 'mbedded.ninja',
logo: {
src: './src/assets/logo.jpg',
},
favicon: '/favicon.ico',
social: {
github: 'https://github.com/gbmhunter/blog',
},
components: {
Footer: "./src/components/starlight/Footer.astro",
Head: "./src/components/starlight/Head.astro",
MarkdownContent: './src/components/starlight/MarkdownContent.astro',
PageTitle: './src/components/starlight/PageTitle.astro',
SkipLink: './src/components/starlight/SkipLink.astro', // Google Analytics is added in here
SocialIcons: './src/components/starlight/SocialIcons.astro',
},
customCss: [
// Relative path to your custom CSS file
"./src/styles/custom.css",
],
head: [
// Katex CSS is required display equations correctly. A good sign this is not included is when
// you each equation twice (once in plain text)
{
tag: 'link',
attrs: {
rel: 'stylesheet',
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css',
},
}
],
}),
],
markdown: {
extendDefaultPlugins: true,
remarkPlugins: [remarkMath],
rehypePlugins: [
[
rehypeKatex,
{
displayMode: false,
strict: false,
// See https://katex.org/docs/options.html for how macros (or other options)
// work
// support eqref
trust: (context) => ['\\htmlId', '\\href'].includes(context.command),
macros: {
"\\b": "\\mathbf{#1}",
"\\bhat": "{\\hat{\\mathbf{#1}}}",
"\\eqref": "\\href{###1}{(\\text{#1})}",
"\\ref": "\\href{###1}{\\text{#1}}",
"\\label": "\\htmlId{#1}{}",
},
},
],
],
},
});