mirror of
https://github.com/nh-server/switch-guide.git
synced 2026-08-15 20:19:49 -07:00
Initialize VitePress
- Add theme submodule - Add initial configuration files - Override theme-default VPFooter with custom theme version
This commit is contained in:
+8
-2
@@ -1,2 +1,8 @@
|
|||||||
site
|
# Node.js and NPM
|
||||||
venv
|
node_modules
|
||||||
|
npm-debug.log*
|
||||||
|
codekit-config.json
|
||||||
|
|
||||||
|
# VitePress
|
||||||
|
docs/.vitepress/cache
|
||||||
|
docs/.vitepress/dist
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "docs/.vitepress/theme"]
|
||||||
|
path = docs/.vitepress/theme
|
||||||
|
url = https://github.com/hacks-guide/vitepress-theme
|
||||||
@@ -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`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
Submodule
+1
Submodule docs/.vitepress/theme added at 1be2c70084
Generated
+2478
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user