You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Guide-WiiU/docs/.vitepress/config.mjs

76 lines
1.9 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'
import * as i18n from './i18n'
export default defineConfig({
title: "Wii U Hacks Guide",
description: "A guide to hacking the Nintendo Wii U.",
head: [['link', { rel: 'icon', href: '/assets/img/favicon.ico' }]],
locales: {
root: i18n.en_US
},
themeConfig: {
docFooter: {
prev: false,
next: false
},
socialLinks: [
{ icon: 'discord', link: 'https://discord.gg/C29hYvh' },
{ icon: 'github', link: 'https://github.com/hacks-guide/Guide-WiiU' }
]
},
vite: {
resolve: {
alias: [
{
find: /^.*\/VPHero\.vue$/,
replacement: fileURLToPath(
new URL('./theme/components/VPHero.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) {
let tokenData = token.info.match(/^ ?tab\s(default\s)?(.*)$/);
let isDefault = typeof tokenData[1] !== 'undefined';
let name = tokenData[2];
return `<Tab name="${name}" ${isDefault ? "default=true" : ""}>`;
} else {
return `</Tab>\n`;
}
}
});
}
}
})