Files
switch-guide/docs/.vitepress/config.mjs
T
lifehackerhansol 141bd8d600 Initialize VitePress
- Add theme submodule
- Add initial configuration files
- Override theme-default VPFooter with custom theme version
2024-12-08 13:20:07 -08:00

60 lines
1.4 KiB
JavaScript

/*
Copyright (C) 2024 Nintendo Homebrew
SPDX-License-Identifier: MIT
*/
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vitepress'
import container from 'markdown-it-container'
export default defineConfig({
title: "NH Switch Guide",
description: "Switch CFW Guide.",
sitemap: {
hostname: 'https://switch.hacks.guide'
},
vite: {
resolve: {
alias: [
{
find: /^.*\/VPDocOutlineItem\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/VPDocOutlineItem.vue', import.meta.url)
)
},
{
find: /^.*\/VPFooter\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/VPFooter.vue', import.meta.url)
)
}
]
}
},
markdown: {
config: (md) => {
md.use(container, "tabs", {
render: (tokens, idx) => {
const token = tokens[idx];
if (token.nesting === 1) {
return `<Tabs ${token.info}>\n`;
} else {
return `</Tabs>\n`;
}
}
});
md.use(container, 'tab', {
render: (tokens, idx) => {
const token = tokens[idx];
if (token.nesting === 1) {
return `<Tab name="${token.info.match(/^ ?tab\s+(.*)$/)[1]}">`;
} else {
return `</Tab>\n`;
}
}
});
}
}
})