-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
86 lines (79 loc) · 2.7 KB
/
astro.config.mjs
File metadata and controls
86 lines (79 loc) · 2.7 KB
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
80
81
82
83
84
85
86
import { defineConfig } from "astro/config";
import { execSync } from "child_process";
import gruvboxMaterialDark from "./gruvbox_syntax_highlighting_theme.json";
import rehypeExternalLinks from "rehype-external-links";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeSlug from "rehype-slug";
import remarkGfm from "remark-gfm";
import remarkSupersub from "remark-supersub";
import remarkSmartypants from "remark-smartypants";
// todo: remake this as custom thing?
// import "remark-collapse" as remarkCollapse;
// https://astro.build/config
export default defineConfig({
devToolbar: { enabled: false },
image: {
responsiveStyles: true,
layout: "constrained",
},
vite: {
define: {
TIME_OF_LAST_COMMIT: (
execSync("git log -1 --pretty=format:'%at'") * 1000
).toString(),
LAST_COMMIT_HASH: new String(
execSync("git log -1 --pretty=format:'%H'"),
),
},
},
markdown: {
shikiConfig: {
theme: gruvboxMaterialDark,
},
remarkPlugins: [
//
// [
// remarkCollapse,
// {
// test: "(contents|collapse)",
// summary: (s) => s,
// },
// ],
// Adds <sup>/<sub> to text formatted like ^sup^ and ~sub~
remarkSupersub,
// Github Flavored Markdown: tables, todo-lists, footnotes, etc
[
remarkGfm,
{
// (singleTilde conflicts with remarkSupersub)
singleTilde: false,
},
],
// Smart typography: automatic em-dashes, curly quotes, etc
[
remarkSmartypants,
{
backticks: false, // no weird `` or '' transformation
dashes: "oldschool", // -- == en-dash, --- == em-dash
},
],
],
rehypePlugins: [
// Makes links open in separate tabs
[
rehypeExternalLinks,
{ target: "_blank", rel: "noopener noreferrer" },
],
// Autogenerates `id` tags for h1-6 html blocks based on their text
[rehypeSlug, {}],
// Inserts icons elements to h1-6 html tags that reference their ids
[rehypeAutolinkHeadings, { behavior: "append" }],
// 'rehype-toc'
],
// Default plugins provided by astro. Disabled so we can customize
gfm: false,
smartypants: false,
// https://shiki.style
syntaxHighlight: "shiki",
},
});