Initialize VitePress

- Add theme submodule
- Add initial configuration files
- Override theme-default VPFooter with custom theme version
This commit is contained in:
lifehackerhansol
2024-09-16 01:36:12 -07:00
parent b951e3323c
commit 141bd8d600
6 changed files with 2565 additions and 2 deletions

10
.gitignore vendored
View File

@@ -1,2 +1,8 @@
site
venv
# Node.js and NPM
node_modules
npm-debug.log*
codekit-config.json
# VitePress
docs/.vitepress/cache
docs/.vitepress/dist

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "docs/.vitepress/theme"]
path = docs/.vitepress/theme
url = https://github.com/hacks-guide/vitepress-theme

View File

@@ -0,0 +1,59 @@
/*
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`;
}
}
});
}
}
})

1
docs/.vitepress/theme Submodule

Submodule docs/.vitepress/theme added at 1be2c70084

2478
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

16
package.json Normal file
View File

@@ -0,0 +1,16 @@
{
"devDependencies": {
"vitepress": "^1.5.0"
},
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.7.1",
"@fortawesome/free-solid-svg-icons": "^6.7.1",
"@fortawesome/vue-fontawesome": "^3.0.8",
"markdown-it-container": "^4.0.0"
}
}