Skip to content

Commit

Permalink
VitePress migration (#188)
Browse files Browse the repository at this point in the history
* Remove vuepress theme submodule

* Switch to VitePress
  • Loading branch information
lifehackerhansol authored Oct 2, 2024
1 parent d5ebe66 commit e13b2d2
Show file tree
Hide file tree
Showing 78 changed files with 2,594 additions and 2,857 deletions.
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Node.js and NPM
node_modules
.temp
.cache
dist
yarn.lock
yarn-error.log
npm-debug.log*
codekit-config.json

# VitePress
docs/.vitepress/cache
docs/.vitepress/dist
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "docs/.vuepress/vuepress-theme"]
path = docs/.vuepress/vuepress-theme
url = https://github.com/emiyl/emiyl-theme
[submodule "docs/.vitepress/theme"]
path = docs/.vitepress/theme
url = https://github.com/cfw-guide/vitepress-theme
85 changes: 85 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
Copyright (C) 2024 Nintendo Homebrew
Copyright (C) 2024 emiyl
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: "Vita Hacks Guide",
description: "A complete guide to PS Vita (TV) custom firmware, from stock to Ensō.",
head: [
['link', { rel: 'icon', href: '/assets/images/favicon.ico' }],
[ 'script', { type: 'text/javascript', src: '//cdn.thisiswaldo.com/static/js/5303.js' } ],
[ 'script', { src: 'https://www.googletagmanager.com/gtag/js?id=UA-152619365-1'} ],
[ 'script', {}, 'function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","UA-152619365-1");' ],
],
locales: {
root: i18n.en_US
},
themeConfig: {
docFooter: {
prev: false,
next: false
},
socialLinks: [
{ icon: 'discord', link: 'https://discord.gg/m7MwpKA' },
{ icon: 'github', link: 'https://github.com/hacks-guide/Guide_Vita' }
],
adUnits: [
'5340',
'5342'
],
},
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`;
}
}
});
}
}
})
119 changes: 119 additions & 0 deletions docs/.vitepress/i18n/en_US.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
const themeConfig = {
search: 'Search',
selectLanguageName: "English",

backToHome: "Take me home",
contributorsText: "Contributors",
editLinkText: "Edit this page",
lastUpdatedText: "Last Updated",
openInNewWindow: "Open in new window",
selectLanguageAriaLabel: "Select language",
toggleDarkMode: "Toggle dark mode",
toggleSidebar: "Toggle sidebar",
discordNoticeText: "For support in English, ask for help at [HENkaku on Discord](https://discord.gg/m7MwpKA).",

nav: [
{
text: 'Guides',
items: [
{ text: 'Adrenaline', link: 'adrenaline' },
{
text: 'SD2Vita',
link: 'yamt'
},
{
text: 'Uninstalling CFW',
link: 'uninstalling-cfw'
},
]
},
{
text: 'Help',
items: [
{ text: 'Troubleshooting', link: 'troubleshooting' },
{ text: 'FAQ', link: 'faq' },
{
text: 'Discord',
link: 'https://discord.gg/m7MwpKA'
},
]
},
{
text: 'Site Info',
items: [
{ text: 'Donations', link: 'donations' },
{ text: 'Credits', link: 'credits' },
{ text: 'Site Navigation', link: 'site-navigation' }
]
},
],

sidebar: {
'/installing-henkaku': [
{
text: 'Guide',
items: [
{ text: 'Home', link: 'index.html' },
{ text: 'Get Started', link: 'get-started' },
{ text: 'Installing HENkaku', link: 'installing-henkaku' },
{ text: 'Installing Ensō (3.60)', link: 'installing-enso-(3.60)' },
{ text: 'Finalizing Setup (3.60)', link: 'finalizing-setup-(3.60)' }
],
},
],
'/installing-enso-(3.60)': [
{
text: 'Guide',
items: [
{ text: 'Home', link: 'index.html' },
{ text: 'Get Started', link: 'get-started' },
{ text: 'Installing HENkaku', link: 'installing-henkaku' },
{ text: 'Installing Ensō (3.60)', link: 'installing-enso-(3.60)' },
{ text: 'Finalizing Setup (3.60)', link: 'finalizing-setup-(3.60)' }
],
},
],
'/finalizing-setup-(3.60)': [
{
text: 'Guide',
items: [
{ text: 'Home', link: 'index.html' },
{ text: 'Get Started', link: 'get-started' },
{ text: 'Installing HENkaku', link: 'installing-henkaku' },
{ text: 'Installing Ensō (3.60)', link: 'installing-enso-(3.60)' },
{ text: 'Finalizing Setup (3.60)', link: 'finalizing-setup-(3.60)' }
],
},
],
'/updating-firmware-(3.74)': [
{
text: 'Guide',
items: [
{ text: 'Updating Firmware (3.74)', link: 'updating-firmware-(3.74)' },
{ text: 'Using HENlo', link:'using-henlo' },
{ text: 'Installing Ensō', link: 'installing-enso' },
{ text: 'Finalizing Setup', link: 'finalizing-setup' }
],
},
],
'/': [
{
text: 'Guide',
items: [
{ text: 'Updating Firmware (3.74)', link: 'updating-firmware-(3.74)' },
{ text: 'Using HENlo', link:'using-henlo' },
{ text: 'Installing Ensō', link: 'installing-enso' },
{ text: 'Finalizing Setup', link: 'finalizing-setup' }
],
},
],
},
};

export default {
lang: 'en-US',
label: "English",
title: 'Vita Hacks Guide',
description: 'A complete guide to PS Vita (TV) custom firmware, from stock to Ensō.',
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 }
File renamed without changes.
1 change: 1 addition & 0 deletions docs/.vitepress/theme
Submodule theme added at fde97d
69 changes: 0 additions & 69 deletions docs/.vuepress/components/Btn.vue

This file was deleted.

28 changes: 0 additions & 28 deletions docs/.vuepress/components/BtnToggler.vue

This file was deleted.

61 changes: 0 additions & 61 deletions docs/.vuepress/config.js

This file was deleted.

Loading

0 comments on commit e13b2d2

Please sign in to comment.