feat: add Astro reference site and organize book contents
Reference site / build (push) Canceled after 0s
Reference site / build (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import './plugins/environment.mjs';
|
||||
import { defineConfig } from 'astro/config';
|
||||
import { unified } from '@astrojs/markdown-remark';
|
||||
import documentLinks, { normalizeBase } from './plugins/document-links.mjs';
|
||||
|
||||
const base = normalizeBase(process.env.SITE_BASE || '/');
|
||||
const site = process.env.SITE_URL || undefined;
|
||||
if (site) {
|
||||
const url = new URL(site);
|
||||
if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== '/') {
|
||||
throw new Error('SITE_URL must be an http(s) origin; use SITE_BASE for a path prefix');
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
output: 'static',
|
||||
site,
|
||||
base,
|
||||
trailingSlash: 'always',
|
||||
markdown: {
|
||||
processor: unified({ remarkPlugins: [[documentLinks, { base }]], smartypants: false }),
|
||||
shikiConfig: { theme: 'github-light', langAlias: { wip: 'text' } },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user