Skip to content

Commit

Permalink
VitePress migration (#237)
Browse files Browse the repository at this point in the history
* Remove docsify.js files

* treewide: Remove obsolete pages and files

- These are no longer used, no longer recommended, and no longer have a
  reason to stay in the guide.
- Of note are the vWii contents, which now live in wii.hacks.guide.

* translations: drop all languages

The migration will break all of them, so it's best to let it get
regenerated by Crowdin.

This also deletes leftover files that don't exist in the main guide.

* Initialize VitePress

- Add theme submodule
- Add initial configuration files
- Override theme-default VPFooter with custom theme version

* docs: port to VitePress

* config: add sidebar/navbar and initial translation support

* config: add footer

* workflow: add VitePress build steps

* crowdin: move to VitePress

* config: add favicon

* config: add GitHub link to navbar

* config: add Discord invite to navbar

* LICENSE: update for VitePress

While the docs are licensed under ISC, the theme is licensed under
MIT. Explicitly specify this.

* Add dependabot configs for npm

* config: add support for `default` keyword in tabs

Specifying `tab default` will allow defaulting to this tab on page
load.

* docs: conditionally enable the prev/next buttons

These only make sense in the Aroma pages; the rest aren't chronological
paths.

* homepage: add custom homepage hero implementation

This retires the old logo, and brings in Plailect's old Wii U guide
image.
  • Loading branch information
lifehackerhansol authored Sep 27, 2024
1 parent 651b5d2 commit c018cee
Show file tree
Hide file tree
Showing 3,811 changed files with 3,280 additions and 117,076 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
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
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy site

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive

- name: Configure GitHub Pages
uses: actions/configure-pages@v5

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build site
run: npm run docs:build

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
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
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test site build

on:
pull_request:

jobs:
doc-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build site
run: npm run docs:build
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Node.js and NPM
node_modules
npm-debug.log*
codekit-config.json

# VitePress
docs/.vitepress/cache
docs/.vitepress/dist

# macOS
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
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
1 change: 0 additions & 1 deletion .htaccess

This file was deleted.

Empty file removed .nojekyll
Empty file.
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

26 changes: 23 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ISC License

Copyright (c) 2021, Nintendo Homebrew Staff
Copyright (c) 2024, Nintendo Homebrew

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand All @@ -13,3 +11,25 @@ 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.
19 changes: 10 additions & 9 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
files:
- source: /docs/**/*.md
ignore:
- /**/assets/
- /**/files/
- LICENSE.md
- README.md
- /**/navbar.md
translation: >-
/translations/%locale_with_underscore%/%original_path%/%original_file_name%
- source: /docs/*.md
translation: /docs/%locale_with_underscore%/%original_file_name%
- source: /docs/archive/tiramisu/*.md
translation: /docs/%locale_with_underscore%/archive/tiramisu/%original_file_name%
- source: /docs/aroma/*.md
translation: /docs/%locale_with_underscore%/aroma/%original_file_name%
- source: /docs/vwii/*.md
translation: /docs/%locale_with_underscore%/vwii/%original_file_name%
- source: /docs/.vitepress/i18n/strings/en_US.json
translation: /docs/.vitepress/i18n/strings/%locale_with_underscore%.json
75 changes: 75 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
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`;
}
}
});
}
}
})
84 changes: 84 additions & 0 deletions docs/.vitepress/i18n/en_US.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { en_US as localeData } from './strings'

const sidebar_troubleshooting = {
text: localeData.troubleshooting,
items: [
{ text: localeData.pages["common-issues-fixes"], link: `/common-issues-fixes` },
{ text: localeData.pages["recover-vwii-ioses-channels"], link: `/recover-vwii-ioses-channels` }
]
}

const sidebar_extras = {
text: localeData.extras,
items: [
{ text: localeData.pages["block-updates"], link: `/block-updates` },
{ text: localeData.pages["unblock-updates"], link: `/unblock-updates` },
{ text: localeData.pages["dump-games"], link: `/dump-games` },
{ text: localeData.pages["uninstall-cbhc"], link: `/uninstall-cbhc` },
{ text: localeData.pages["uninstall-indexiine"], link: `/uninstall-indexiine` },
{ text: localeData.pages["uninstall-payloadloader"], link: `/uninstall-payloadloader` }
]
}

const sidebar_common = {
text: localeData.other,
items: [
{ text: localeData.pages["about"], link: `/about` },
{ text: localeData.pages["donations"], link: `/donations` },
{ text: localeData.pages["privacy-policy"], link: `/privacy-policy` }
]
}

const themeConfig = {
langMenuLabel: localeData.langMenuLabel,
darkModeSwitchLabel: localeData.darkModeSwitchLabel,
darkModeSwitchTitle: localeData.darkModeSwitchTitle,
lightModeSwitchTitle: localeData.lightModeSwitchTitle,
sidebarMenuLabel: localeData.sidebarMenuLabel,
returnToTopLabel: localeData.returnToTopLabel,

nav: [
{ text: localeData.pages["faq"], link: `/faq` },
sidebar_troubleshooting,
sidebar_extras
],
sidebar: {
/*
The `/` path needs to be at the bottom as a catch all! If it is placed anywhere above,
it will select the first matching one and not parse the rest!
*/
[`/`]: [
{
text: localeData.guide,
items: [
{ text: localeData.pages["aroma/getting-started"], link: `/aroma/getting-started` },
{ text: localeData.pages["aroma/sd-preparation"], link: `/aroma/sd-preparation` },
{ text: localeData.pages["aroma/browser-exploit"], link: `/aroma/browser-exploit` },
{ text: localeData.pages["aroma/nand-backup"], link: `/aroma/nand-backup` },
{ text: localeData.pages["aroma/installing-payloadloader"], link: `/aroma/installing-payloadloader` },
{ text: localeData.pages["aroma/autobooting"], link: `/aroma/autobooting` },
{ text: localeData.pages["finalizing-setup"], link: `/aroma/finalizing-setup` }
]
},
sidebar_troubleshooting,
sidebar_extras,
sidebar_common
],
},
footer: {
copyright: 'Copyright © 2024 Nintendo Homebrew',
items: [
{ text: localeData.pages["about"], link: `/about` },
{ text: localeData.pages["donations"], link: `/donations` },
{ text: localeData.pages["privacy-policy"], link: `/privacy-policy` }
]
}
};

export default {
lang: "en",
label: localeData.language,
title: localeData.title,
description: localeData.description,
themeConfig: themeConfig
}
3 changes: 3 additions & 0 deletions docs/.vitepress/i18n/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import en_US from './en_US'

export { en_US }
37 changes: 37 additions & 0 deletions docs/.vitepress/i18n/strings/en_US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"language": "English",
"title": "Wii U Hacks Guide",
"description": "A guide to hacking the Nintendo Wii U.",
"langMenuLabel": "Switch language",
"darkModeSwitchLabel": "Appearance",
"darkModeSwitchTitle": "Switch to dark theme",
"lightModeSwitchTitle": "Switch to light theme",
"sidebarMenuLabel": "Menu",
"returnToTopLabel": "Return to top",

"guide": "Guide",
"extras": "Extras",
"other": "Other",
"troubleshooting": "Troubleshooting",
"pages": {
"about": "About This Guide",
"aroma/autobooting": "Autobooting Aroma",
"aroma/getting-started": "Aroma",
"aroma/browser-exploit": "Browser Exploit",
"aroma/installing-payloadloader": "Installing PayloadLoader",
"aroma/nand-backup": "Making a NAND Backup",
"aroma/sd-preparation": "SD Preparation",
"block-updates": "Blocking Updates",
"common-issues-fixes": "Common Issues & Fixes",
"donations": "Donations",
"dump-games": "Dumping Wii U Discs",
"faq": "FAQ",
"finalizing-setup": "Finalizing Setup",
"privacy-policy": "Privacy Policy",
"recover-vwii-ioses-channels": "Recover a vWii IOS/Channel",
"unblock-updates": "Unblocking Updates",
"uninstall-cbhc": "Uninstall CBHC",
"uninstall-indexiine": "Uninstall Indexiine",
"uninstall-payloadloader": "Uninstall PayloadLoader"
}
}
3 changes: 3 additions & 0 deletions docs/.vitepress/i18n/strings/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import en_US from './en_US' with { type: 'json' }

export { en_US }
1 change: 1 addition & 0 deletions docs/.vitepress/theme
Submodule theme added at 798ac6
Loading

0 comments on commit c018cee

Please sign in to comment.