-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathastro.config.mjs
84 lines (82 loc) · 2.31 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
80
81
82
83
84
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import AutoImport from "astro-auto-import";
import { defineConfig } from "astro/config";
import remarkCollapse from "remark-collapse";
import remarkToc from "remark-toc";
import config from "./src/config/config.json";
import expressiveCode from "astro-expressive-code";
import remarkMermaid from "remark-mermaidjs";
import rehypeExternalLinks from 'rehype-external-links';
// https://astro.build/config
export default defineConfig({
site: config.site.base_url ? config.site.base_url : "http://www.throughputfocus.com",
base: config.site.base_path ? config.site.base_path : "/",
trailingSlash: config.site.trailing_slash ? "always" : "never",
//image: {
// service: squooshImageService(),
//},
integrations: [
react(),
sitemap({
serialize(item) {
if (/contact_.*[a-z]|test-[a-z]|elements/.test(item.url)) { // Update this to exclude more pages from site-map
return undefined;
}
// Make sure that any blog posts with todays date n url and the blog index page have a lastmod date
let dateString = `${new Date().toLocaleString("en-CA", { timeZone: "Europe/London" }).slice(0, 10)}.*|blog`;
if (new RegExp(dateString, 'i').test(item.url)) {
item.changefreq = 'daily';
item.lastmod = new Date();
item.priority = 0.9;
}
return item;
},
}),
tailwind({
config: {
applyBaseStyles: false,
},
}),
AutoImport({
imports: [
"@/shortcodes/Button",
"@/shortcodes/Accordion",
"@/shortcodes/Notice",
"@/shortcodes/Video",
"@/shortcodes/Youtube",
"@/shortcodes/Tabs",
"@/shortcodes/Tab",
],
}),
expressiveCode(),
mdx(),
],
markdown: {
remarkPlugins: [
remarkMermaid,
remarkToc,
[
remarkCollapse,
{
test: "Table of contents",
},
],
],
rehypePlugins: [
[
rehypeExternalLinks,
{
content: { type: 'text', value: ' 🔗' }
}
],
],
shikiConfig: {
theme: "one-dark-pro",
wrap: true,
},
extendDefaultPlugins: true,
},
});