mirror of
https://github.com/nh-server/switch-guide
synced 2025-10-05 23:22:39 +02:00
Initialize VitePress
- Add theme submodule - Add initial configuration files - Override theme-default VPFooter with custom theme version
This commit is contained in:
10
.gitignore
vendored
10
.gitignore
vendored
@@ -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
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "docs/.vitepress/theme"]
|
||||
path = docs/.vitepress/theme
|
||||
url = https://github.com/hacks-guide/vitepress-theme
|
59
docs/.vitepress/config.mjs
Normal file
59
docs/.vitepress/config.mjs
Normal 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
1
docs/.vitepress/theme
Submodule
Submodule docs/.vitepress/theme added at 1be2c70084
2478
package-lock.json
generated
Normal file
2478
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
package.json
Normal file
16
package.json
Normal 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"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user