Skip to content

Commit

Permalink
treewide: update to VuePress 2.0.0-rc0, switch to emiyl's theme rewrite
Browse files Browse the repository at this point in the history
- We can finally use Node 20
- Translations will be temporarily borked until Crowdin does its replication
- Move some configs around to align with new theme
- Searchbar is gone
  • Loading branch information
lifehackerhansol committed Jan 13, 2024
1 parent ad4a17a commit 460f26d
Show file tree
Hide file tree
Showing 11 changed files with 2,420 additions and 3,182 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 20

- name: Install dependencies
run: npm ci
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "docs/.vuepress/theme"]
[submodule "docs/.vuepress/vuepress-theme"]
path = docs/.vuepress/vuepress-theme
url = https://github.com/emiyl/emiyl-theme
url = https://github.com/emiyl/emiyl-theme-2
68 changes: 0 additions & 68 deletions docs/.vuepress/components/Tab.vue

This file was deleted.

13 changes: 0 additions & 13 deletions docs/.vuepress/components/Tabs.vue

This file was deleted.

138 changes: 40 additions & 98 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,137 +1,85 @@
const { i18n, themeConfig } = require("./i18n");
const { localTheme } = require('./vuepress-theme');
const container = require('markdown-it-container');
const path = require("path");
const { registerComponentsPlugin } = require('@vuepress/plugin-register-components');
const { searchPlugin } = require('@vuepress/plugin-search');
const { emiylTheme } = require('./vuepress-theme');

themeConfig.translate.selectLanguageName = "Translate";

module.exports = {
plugins: [
searchPlugin({
locales: {
"/": {
placeholder: i18n.en_US.search
},
"/de_DE/": {
placeholder: i18n.de_DE.search
},
"/es_ES/": {
placeholder: i18n.es_ES.search
},
"/fr_FR/": {
placeholder: i18n.fr_FR.search
},
"/hu_HU/": {
placeholder: i18n.hu_HU.search
},
"/it_IT/": {
placeholder: i18n.it_IT.search
},
"/ja_JP/": {
placeholder: i18n.ja_JP.search
},
"/pl_PL/": {
placeholder: i18n.pl_PL.search
},
"/ro_RO/": {
placeholder: i18n.ro_RO.search
},
"/zh_CN/": {
placeholder: i18n.zh_CN.search
},
"/translate/": {
placeholder: i18n.translate.search
}
}
}),
registerComponentsPlugin({
componentsDir: path.resolve(__dirname, './components')
})
],

head: [
[ 'link', { rel: 'apple-touch-icon', sizes: "180x180", href: '/assets/favicon/apple-touch-icon.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "16x16", href: '/assets/favicon/favicon-16x16.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "32x32", href: '/assets/favicon/favicon-32x32.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "192x192", href: '/assets/favicon/android-chrome-192x192.png' } ],
[ 'link', { rel: 'manifest', href: '/assets/favicon/manifest.json' } ],
[ 'link', { rel: 'mask-icon', color: '#2E3440', href: '/assets/favicon/safari-pinned-tab.svg' } ],
[ 'link', { rel: 'shortcut icon', href: '/assets/favicon/favicon.ico' } ],
[ 'link', { rel: 'stylesheet', href: 'https://use.fontawesome.com/releases/v5.6.1/css/all.css' } ],
[ 'meta', { name: 'msapplication-TileColor', content: '#2E3440' } ],
[ 'meta', { name: 'msapplication-TileImage', content: '/assets/favicon/mstile-144x144.png' } ],
[ 'meta', { name: 'msapplication-config', content: '/assets/favicon/browserconfig.xml' } ],
[ 'meta', { name: 'theme-color', content: '#2E3440' } ],
[ 'script', { type: 'text/javascript', src: '//cdn.thisiswaldo.com/static/js/8406.js' } ],
[ 'script', {}, 'if (localStorage.getItem("vuepress-color-scheme") === "dark" || (localStorage.getItem("vuepress-color-scheme") !== "light" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches))) document.documentElement.classList.add("dark");' ]
],
locales: {
// The key is the path for the locale to be nested under.
// As a special case, the default locale can use "/" as its path.
"/": {
lang: "en-US", // this will be set as the lang attribute on <html>
title: i18n.en_US.title,
description: i18n.en_US.description
description: i18n.en_US.description,
discordNoticeText: i18n.en_US.discordNoticeText
},
"/de_DE/": {
lang: "de-DE",
title: i18n.de_DE.title,
description: i18n.de_DE.description
description: i18n.de_DE.description,
discordNoticeText: i18n.de_DE.discordNoticeText
},
"/es_ES/": {
lang: "es-ES",
title: i18n.es_ES.title,
description: i18n.es_ES.description
description: i18n.es_ES.description,
discordNoticeText: i18n.es_ES.discordNoticeText
},
"/fr_FR/": {
lang: "fr-FR",
title: i18n.fr_FR.title,
description: i18n.fr_FR.description
description: i18n.fr_FR.description,
discordNoticeText: i18n.fr_FR.discordNoticeText
},
"/hu_HU/": {
lang: "hu-HU",
title: i18n.hu_HU.title,
description: i18n.hu_HU.description
description: i18n.hu_HU.description,
discordNoticeText: i18n.hu_HU.discordNoticeText
},
"/it_IT/": {
lang: "it-IT",
title: i18n.it_IT.title,
description: i18n.it_IT.description
description: i18n.it_IT.description,
discordNoticeText: i18n.it_IT.discordNoticeText
},
"/ja_JP/": {
lang: "ja-JP",
title: i18n.ja_JP.title,
description: i18n.ja_JP.description
description: i18n.ja_JP.description,
discordNoticeText: i18n.ja_JP.discordNoticeText
},
"/pl_PL/": {
lang: "pl-PL",
title: i18n.pl_PL.title,
description: i18n.pl_PL.description
description: i18n.pl_PL.description,
discordNoticeText: i18n.pl_PL.discordNoticeText
},
"/ro_RO/": {
lang: "ro-RO",
title: i18n.ro_RO.title,
description: i18n.ro_RO.description
description: i18n.ro_RO.description,
discordNoticeText: i18n.ro_RO.discordNoticeText
},
"/zh_CN/": {
lang: "zh-CN",
title: i18n.zh_CN.title,
description: i18n.zh_CN.description
description: i18n.zh_CN.description,
discordNoticeText: i18n.zh_CN.discordNoticeText
},
"/translate/": {
lang: "en",
title: i18n.translate.title,
description: i18n.translate.description,
discordNoticeText: i18n.translate.discordNoticeText,
head: [
[ 'script', {}, "var _jipt=[];_jipt.push(['project','dsi-guide']);_jipt.push(['escape',function(){window.location.href='https://dsi.cfw.guide'}]);" ],
[ 'script', {src: "//cdn.crowdin.com/jipt/jipt.js"} ]
],
}
},

theme: localTheme({
theme: emiylTheme({
repo: "cfw-guide/dsi.cfw.guide",
docsBranch: "master",
docsDir: "docs",
Expand All @@ -158,27 +106,21 @@ module.exports = {
lastUpdated: false
}),

extendsMarkdown: (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 ${token.info}>\n`;
} else {
return `</Tab>\n`;
}
}
});
}
head: [
[ 'link', { rel: 'apple-touch-icon', sizes: "180x180", href: '/assets/favicon/apple-touch-icon.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "16x16", href: '/assets/favicon/favicon-16x16.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "32x32", href: '/assets/favicon/favicon-32x32.png' } ],
[ 'link', { rel: 'icon', type: 'image/png', sizes: "192x192", href: '/assets/favicon/android-chrome-192x192.png' } ],
[ 'link', { rel: 'manifest', href: '/assets/favicon/manifest.json' } ],
[ 'link', { rel: 'mask-icon', color: '#2E3440', href: '/assets/favicon/safari-pinned-tab.svg' } ],
[ 'link', { rel: 'shortcut icon', href: '/assets/favicon/favicon.ico' } ],
[ 'link', { rel: 'stylesheet', href: 'https://use.fontawesome.com/releases/v5.6.1/css/all.css' } ],
[ 'meta', { name: 'msapplication-TileColor', content: '#2E3440' } ],
[ 'meta', { name: 'msapplication-TileImage', content: '/assets/favicon/mstile-144x144.png' } ],
[ 'meta', { name: 'msapplication-config', content: '/assets/favicon/browserconfig.xml' } ],
[ 'meta', { name: 'theme-color', content: '#2E3440' } ],
[ 'script', { type: 'text/javascript', src: '//cdn.thisiswaldo.com/static/js/8406.js' } ]
],

shouldPrefetch: true,
};
1 change: 1 addition & 0 deletions docs/.vuepress/i18n/i18n/en_US.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
title: "DSi Guide",
description: "The complete guide to modding your Nintendo DSi",
discordNoticeText: "Join the [DS⁽ⁱ⁾ Mode Hacking!](https://discord.gg/yD3spjv) Discord server for guide development and help.",

search: "Search"
};
1 change: 0 additions & 1 deletion docs/.vuepress/i18n/themeConfig/en_US.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
selectLanguageAriaLabel: "Select language",
toggleDarkMode: "toggle dark mode",
toggleSidebar: "toggle sidebar",
discordNoticeText: "Join the [DS⁽ⁱ⁾ Mode Hacking!](https://discord.gg/yD3spjv) Discord server for guide development and help.",

navbar: [
"sd-card-setup",
Expand Down
Loading

0 comments on commit 460f26d

Please sign in to comment.