Skip to content

Commit

Permalink
feat: support i18n(AlmaLinux#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
everfu committed Jun 13, 2024
1 parent 55dec32 commit b369ded
Show file tree
Hide file tree
Showing 138 changed files with 19,545 additions and 271 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
yarn.lock
pnpm-lock.yaml
271 changes: 0 additions & 271 deletions docs/.vuepress/config.js

This file was deleted.

68 changes: 68 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { defineConfig } from 'vuepress/config'

import * as zhConfig from './config/zh'
import * as enConfig from './config/en'

export default defineConfig(({
title: 'AlmaLinux Wiki',
description: 'AlmaLinux OS Documentation',
head: [ ['script', {}, `
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.almalinux.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '5']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
`],
['link', { rel: "shortcut icon", type: 'image/png', href: "/images/logo.png"}],
],
locales: {
'/': {
lang: 'en',
title: 'AlmaLinux Wiki',
description: 'AlmaLinux OS Documentation',
},
'/zh/': {
lang: 'zh',
title: 'AlmaLinux Wiki',
description: 'AlmaLinux OS 文档',
}
},
themeConfig: {
logo: '/images/logo.png',
locales: {
'/': {
label: 'English',
selectText: 'Languages',
ariaLabel: 'Select language',
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
nav: enConfig.navbar,
sidebar: enConfig.sidebar
},
'/zh/': {
label: '简体中文',
selectText: '选择语言',
ariaLabel: '选择语言',
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '上次更新',
nav: zhConfig.navbar,
sidebar: zhConfig.sidebar
}
},
// AlmaLinux organization on GitHub
repo: 'AlmaLinux/',
// wiki repository settings
docsRepo: 'AlmaLinux/wiki',
docsDir: 'docs',
docsBranch: 'master',
// editing works only for users with the repository write-access so we
// disabled it to avoid confusion
editLinks: false
},
}))
2 changes: 2 additions & 0 deletions docs/.vuepress/config/en/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './navbar'
export * from './sidebar'
6 changes: 6 additions & 0 deletions docs/.vuepress/config/en/navbar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const navbar = [
{ text: 'Home', link: 'https://almalinux.org/' },
{ text: 'Chat', link: 'https://chat.almalinux.org/' },
{ text: 'Mailing Lists', link: 'https://lists.almalinux.org/' },
{ text: 'Bugs', link: 'https://bugs.almalinux.org/' }
]
Loading

0 comments on commit b369ded

Please sign in to comment.