mirror of
https://github.com/nh-server/switch-guide.git
synced 2026-08-15 20:19:49 -07:00
- Add theme submodule - Add initial configuration files - Override theme-default VPFooter with custom theme version
60 lines
1.4 KiB
JavaScript
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`;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
})
|