[READ-ONLY] Mirror of https://github.com/flo-bit/tiny-docs. quick setup, simple, minimalistic docs for your github project
flo-bit.dev/tiny-docs/
2.2 kB
91 lines
1// @ts-check
2import { defineConfig } from "astro/config";
3import { resolve } from "path";
4import remarkMath from "remark-math";
5import rehypeMathjax from "rehype-mathjax";
6
7import mdx from "@astrojs/mdx";
8import sitemap from "@astrojs/sitemap";
9import tailwind from "@astrojs/tailwind";
10import svelte from "@astrojs/svelte";
11
12import pagefind from "astro-pagefind";
13import customEmbeds from "./custom-embeds";
14import remarkGithubAdmonitionsToDirectives from "remark-github-admonitions-to-directives";
15
16import {
17 transformerMetaHighlight,
18 transformerNotationHighlight,
19} from "@shikijs/transformers";
20
21import LinkCardEmbed from "./src/embeds/link-card/embed";
22import YoutubeEmbed from "./src/embeds/youtube/embed";
23import ExcalidrawEmbed from "./src/embeds/excalidraw/embed";
24import GithubEmbed from "./src/embeds/github/embed";
25import { calloutEmbeds } from "./src/embeds/callouts/embeds";
26
27import react from "@astrojs/react";
28import { config } from "./config.server";
29import fixLinks from "./transform-links";
30
31// https://astro.build/config
32export default defineConfig({
33 vite: {
34 resolve: {
35 alias: {
36 $components: resolve("./src/components"),
37 $layouts: resolve("./src/layouts"),
38 $pages: resolve("./src/pages"),
39 $assets: resolve("./src/assets"),
40 $content: resolve("./src/content"),
41 },
42 },
43 define: {
44 __PUBLIC_CONFIG__: JSON.stringify(config),
45 },
46 },
47
48 integrations: [
49 pagefind(),
50 customEmbeds({
51 embeds: [
52 ExcalidrawEmbed,
53 YoutubeEmbed,
54 GithubEmbed,
55 LinkCardEmbed,
56 ...calloutEmbeds,
57 ],
58 }),
59 fixLinks(),
60 mdx(),
61 sitemap(),
62 tailwind(),
63 svelte(),
64 react(),
65 ],
66
67 markdown: {
68 shikiConfig: {
69 themes: {
70 light: "github-light",
71 dark: "github-dark",
72 },
73 defaultColor: false,
74 transformers: [
75 transformerMetaHighlight(),
76 transformerNotationHighlight(),
77 ],
78 wrap: true,
79 },
80
81 remarkPlugins: [remarkGithubAdmonitionsToDirectives, remarkMath],
82 rehypePlugins: [rehypeMathjax],
83 },
84
85 prefetch: {
86 prefetchAll: true,
87 },
88 site: config.SITE ?? undefined,
89 base: config.BASE ?? "/",
90 output: "static",
91});