noway.moe/astro.config.mjs

61 lines
1.9 KiB
JavaScript
Raw Normal View History

2023-12-25 22:27:19 -07:00
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
2023-12-25 23:43:02 -07:00
//import cloudflare from "@astrojs/cloudflare";
import remarkGfm from "remark-gfm";
import remarkRehype from "remark-rehype";
2023-12-26 03:45:47 -07:00
import rehypePrettyCode from "rehype-pretty-code";
2023-12-26 03:46:58 -07:00
import json from "./public/themes/github_light.json" assert { type: "json" };
2023-12-25 22:27:19 -07:00
import tailwind from "@astrojs/tailwind";
2023-12-26 03:45:47 -07:00
const options = {
// Specify the theme to use or a custom theme json, in our case
// it will be a moonlight-II theme from
// https://github.com/atomiks/moonlight-vscode-theme/blob/master/src/moonlight-ii.json
theme: json,
// Callbacks to customize the output of the nodes
onVisitLine(node) {
// Prevent lines from collapsing in `display: grid` mode, and
// allow empty lines to be copy/pasted
if (node.children.length === 0) {
node.children = [{type: 'text', value: ' '}];
}
},
onVisitHighlightedLine(node) {
// Adding a class to the highlighted line
node.properties.className.push('highlighted');
},
};
2023-12-25 22:27:19 -07:00
// https://astro.build/config
export default defineConfig({
2023-12-25 23:43:02 -07:00
site: 'https://dev.noway.moe',
output: "static",
2023-12-25 22:27:19 -07:00
integrations: [mdx(), sitemap(), tailwind()],
2023-12-25 23:43:02 -07:00
build: {
format: "file",
inlineStylesheets: "auto",
},
markdown: {
2023-12-26 03:45:47 -07:00
gfm: true,
syntaxHighlight: false,
2023-12-25 23:43:02 -07:00
remarkPlugins: [
remarkGfm,
[remarkRehype, { clobberPrefix: "" }],
2023-12-26 03:45:47 -07:00
[rehypePrettyCode, options],
2023-12-25 23:43:02 -07:00
],
2023-12-26 03:45:47 -07:00
//shikiConfig: {
// // Choose from Shiki's built-in themes (or add your own)
// // https://github.com/shikijs/shiki/blob/main/docs/themes.md
// theme: 'dracula',
// // Add custom languages
// // Note: Shiki has countless langs built-in, including .astro!
// // https://github.com/shikijs/shiki/blob/main/docs/languages.md
// langs: ["c", "ssh-config"],
// // Enable word wrap to prevent horizontal scrolling
// wrap: true,
//},
2023-12-25 23:43:02 -07:00
}
});