-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VitePress migration #230
Open
lifehackerhansol
wants to merge
15
commits into
nh-server:master
Choose a base branch
from
lifehackerhansol:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
VitePress migration #230
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
46b4c41
Remove mkdocs files
lifehackerhansol 5c15d98
Initialize VitePress
lifehackerhansol b613c02
LICENSE: update for VitePress
lifehackerhansol 0a62e17
Add dependabot configs for npm
lifehackerhansol 82b0336
workflow: add VitePress build steps
lifehackerhansol 3f6fcc2
docs: port to VitePress
lifehackerhansol 58ddaaf
homepage: add custom homepage hero implementation
lifehackerhansol de929c1
config: add favicon
lifehackerhansol 925ec05
config: add GitHub link to navbar
lifehackerhansol 00fb299
config: add Discord invite to navbar
lifehackerhansol c63ec66
config: add sidebar/navbar and initial translation support
lifehackerhansol 6d54eee
config: add footer
lifehackerhansol bdcfd62
config: disable prev/next buttons entirely
lifehackerhansol 4eadc25
config: add support for `default` keyword in tabs
lifehackerhansol 17f15fb
docs: nuke :material-arrow-right:
lifehackerhansol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,53 +3,52 @@ name: Deploy site | |
on: | ||
push: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
doc-deploy: | ||
runs-on: ubuntu-22.04 | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
submodules: recursive | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
with: | ||
# Semantic version range syntax or exact version of a Python version | ||
python-version: '3.11.0' | ||
|
||
# You can test your matrix by printing the current Python version | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
- name: Configure GitHub Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
run: npm ci | ||
|
||
- name: Run Mkdocs | ||
# Build the site using mkdocs | ||
run: mkdocs build --verbose --clean --strict | ||
- name: Build site | ||
run: npm run docs:build | ||
|
||
- name: Post-Mkdocs touch/copy files | ||
# miscellaneous files needed for GitHub etc | ||
run: | | ||
touch site/.nojekyll | ||
cp CNAME site/CNAME | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/[email protected] | ||
- name: Upload GitHub Pages artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: site # The folder the action should deploy. | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
path: docs/.vitepress/dist | ||
|
||
# Deployment job | ||
deploy: | ||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,26 @@ | ||
name: Test build | ||
name: Test site build | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
doc-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
submodules: recursive | ||
|
||
- name: Set up Python 3.x | ||
uses: actions/setup-python@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
# Semantic version range syntax or exact version of a Python version | ||
python-version: '3.11.0' | ||
|
||
# You can test your matrix by printing the current Python version | ||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
|
||
- name: Cache pip | ||
uses: actions/cache@v3 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
${{ runner.os }}- | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
run: npm ci | ||
|
||
- name: Run Mkdocs | ||
# Build the site using mkdocs | ||
run: mkdocs build --verbose --clean --strict | ||
- name: Build site | ||
run: npm run docs:build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "docs/.vitepress/theme"] | ||
path = docs/.vitepress/theme | ||
url = https://github.com/hacks-guide/vitepress-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,35 @@ | ||
ISC License (ISC) | ||
Copyright (c) 2024, Nintendo Homebrew | ||
|
||
Copyright 2023 Nintendo Homebrew Staff | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted, provided that the above | ||
copyright notice and this permission notice appear in all copies. | ||
|
||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
Additionally, files in `docs/.vitepress` is licensed under the following: | ||
|
||
Copyright (c) 2024, Nintendo Homebrew | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
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: "NH Switch Guide", | ||
description: "Switch CFW Guide.", | ||
head: [['link', { rel: 'icon', href: '/img/favicon.ico' }]], | ||
themeConfig: { | ||
docFooter: { | ||
prev: false, | ||
next: false | ||
}, | ||
socialLinks: [ | ||
{ icon: 'discord', link: 'https://discord.gg/C29hYvh' }, | ||
{ icon: 'github', link: 'https://github.com/nh-server/switch-guide' } | ||
] | ||
}, | ||
locales: { | ||
root: i18n.en_US | ||
}, | ||
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) | ||
) | ||
}, | ||
{ | ||
find: /^.*\/VPHero\.vue$/, | ||
replacement: fileURLToPath( | ||
new URL('./theme/components/VPHero.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`; | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Unrelated to this file)
Do you think it's worth having a CI build check linting, so after you fixing stuff it stays consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of any particular one; would be nice to have though.