docs: more i18n

This commit is contained in:
YunYouJun 2023-10-04 05:27:58 +08:00
parent 380d64a16a
commit 11720359e6
49 changed files with 175 additions and 82 deletions

View File

@ -39,8 +39,8 @@ const filteredAddons = computed(() => {
type="text" name="search"
>
</div>
<ul class="m-0 p-0 sm:grid-cols-1 lg:grid-cols-2 grid" gap="4">
<li v-for="addon, i in filteredAddons" :key="i" class="w-full list-none">
<ul class="m-0! p-0! sm:grid-cols-1 lg:grid-cols-2 grid" gap="4">
<li v-for="addon, i in filteredAddons" :key="i" class="w-full list-none m-0!">
<AddonGalleryCard :addon="addon" />
</li>
</ul>

View File

@ -12,14 +12,14 @@ defineProps<{
dark="border-dark-200"
hover="bg-$va-c-bg shadow-md"
>
<a class="text-purple-600 dark:text-purple-300" mr-2 :href="addon.repo" target="_blank">
<h3 flex="~" justify-center items-center my-2 font="light">
<a class="text-purple-600! dark:text-purple-300! decoration-none!" mr-2 :href="addon.repo" target="_blank">
<h3 flex="~" justify-center items-center class="my-2!" font="light">
<div class="text-black dark:text-white" text-xl mr-1 i-ri-github-line />
<span>{{ addon.name }}</span>
</h3>
</a>
<p my-1 text-xl>
<a mr-2 class="text-red-600" :href="`https://npmjs.com/package/${addon.name}`" target="_blank" alt="NPM Package">
<p class="my-1! text-xl!">
<a mr-2 class="text-red-600!" :href="`https://npmjs.com/package/${addon.name}`" target="_blank" alt="NPM Package">
<div i-ri-npmjs-line />
</a>
@ -27,10 +27,10 @@ defineProps<{
<div i-ri-github-line />
</a> -->
</p>
<p my-1 class="text-truncate">
<p class="text-truncate my-1!">
{{ addon.desc }}
</p>
<ul class=" m-0 p-0 flex flex-wrap" items-center op="70">
<ul class="m-0! p-0! flex flex-wrap" items-center op="70">
<span inline-flex mr-1>
<div :class="addon.icon" />
</span>

View File

@ -37,8 +37,8 @@ const filteredThemes = computed(() => {
type="text" name="search"
>
</div>
<ul class="m-0 p-0 sm:grid-cols-1 lg:grid-cols-2 grid" gap="4">
<li v-for="theme, i in filteredThemes" :key="i" class="w-full list-none">
<ul class="m-0! p-0! sm:grid-cols-1 lg:grid-cols-2 grid" gap="4">
<li v-for="theme, i in filteredThemes" :key="i" class="w-full list-none m-0!">
<div
class="transition bg-$va-c-bg-alt" border rounded-xl
dark="border-dark-200"
@ -52,25 +52,21 @@ const filteredThemes = computed(() => {
</a>
</div>
<div px-4 pb-4>
<a :href="theme.repo" target="_blank">
<a :href="theme.repo" target="_blank" class="decoration-none!">
<h3 mt-5 flex justify-center items-center>
<div text-xl mr-2 :class="theme.icon" />
<span>{{ theme.name }}</span>
</h3>
</a>
<p my-1 text-xl>
<a mr-2 class="text-red-600" :href="`https://npmjs.com/package/${theme.name}`" target="_blank" alt="NPM Package">
<p class="my-1! text-xl!">
<a mr-2 class="text-red-600!" :href="`https://npmjs.com/package/${theme.name}`" target="_blank" alt="NPM Package">
<div i-ri-npmjs-line />
</a>
<!-- <a mr-2 class="text-black dark:text-white" :href="addon.repo" target="_blank" alt="GitHub Repo">
<div i-ri-github-line />
</a> -->
</p>
<p my-1>
<p class="my-1!">
{{ theme.desc }}
</p>
<ul class=" m-0 p-0 flex flex-wrap">
<ul class="m-0! p-0! flex flex-wrap">
<span v-for="tag, j in theme.tags" :key="j" class="break-all text-gray mr-6px">
#{{ tag }}
</span>

View File

@ -1,2 +1,40 @@
gallery:
tip: search
button:
get-started: Get Started
view-github: View Github
menu:
guide: Guide
theme: Themes
addon: Addons
getting-started: Getting Started
migrate-from-other: Migrate from Other
use-a-theme: Use A Theme
write-a-theme: Write A Theme
themes-gallery: Themes Gallery
why-need-addons: Why need addons?
use-an-addon: Use An Addon
write-an-addon: Write An Addon
addons-gallery: Addons Gallery
category:
getting-started: Getting Started
guide: Guide
config: Config
migration: Migration
third: Third
custom: Custom
theme: Theme
addon: Addon
dev: Dev
banner:
next-generation: Next Generation
static: Static
blog: Blog
framework: Framework

View File

@ -1,2 +1,40 @@
gallery:
tip: 搜索
button:
get-started: 快速上手
view-github: 查看 Github
menu:
guide: 指南
theme: 主题
addon: 插件
getting-started: 起步
migrate-from-other: 从其他框架迁移
use-a-theme: 使用主题
write-a-theme: 编写主题
themes-gallery: 主题橱窗
why-need-addons: 为什么需要插件?
use-an-addon: 使用插件
write-an-addon: 编写插件
addons-gallery: 插件橱窗
category:
getting-started: 起步
guide: 指南
config: 配置
migration: 迁移
third: 第三方
custom: 自定义
theme: 主题
addon: 插件
dev: 开发
banner:
next-generation: 下一代
static: 静态
blog: 博客
framework: 框架

View File

@ -2,7 +2,7 @@
title: Valaxy Addons Gallery
title_zh-CN: Valaxy 插件橱窗
categories:
- Addon
- addon
end: false
addons:

View File

@ -1,8 +1,8 @@
---
title: Why Addon?
title_zh-CN: 为什么需要插件
title_zh-CN: 为什么需要插件
categories:
- Addon
- addon
---
::: zh-CN
@ -61,4 +61,4 @@ What can addons do?
For example, they can create a Live2D widget, a global music player, or modify some configurations of Vite and its built-in plugins.
Addons are used to complement what Vite/Vue plugins cannot achieve or to simplify complicated configurations.
:::
:::

View File

@ -2,7 +2,7 @@
title: Use Addon
title_zh-CN: 使用插件
categories:
- Addon
- addon
---
## How To Use

View File

@ -2,7 +2,7 @@
title: Write a Addon
title_zh-CN: 编写一个插件
categories:
- Addon
- addon
end: false
@ -14,6 +14,7 @@ end: false
::: tip
**约定大于配置**
- 插件:`Addon`,须以 `valaxy-addon-` 开头。
- 插件与主题类似,但做的事情更少。
- 一个站点只能使用一个主题,但可以使用多个插件。
- Addon 无需预编译,直接发布源文件即可。

View File

@ -2,7 +2,7 @@
title: Participate in Docs
title_zh-CN: 参与文档
categories:
- Dev
- dev
end: false
---

View File

@ -2,7 +2,7 @@
title: FAQ
title_zh-CN: 常见问题
categories:
- Dev
- dev
end: false
---

View File

@ -2,7 +2,7 @@
title: Participate in Development
title_zh-CN: 参与开发
categories:
- Dev
- dev
end: false
---

View File

@ -2,7 +2,7 @@
title: FAQ
title_zh-CN: 常见问题
categories:
- Guide
- guide
end: false
---

View File

@ -2,7 +2,7 @@
title: Best Practice
title_zh-CN: 最佳实践
categories:
- Guide
- guide
top: 1
---

View File

@ -2,7 +2,7 @@
title: Components
title_zh-CN: 组件
categories:
- Guide
- guide
end: false
---

View File

@ -2,7 +2,7 @@
title: Commands
title_zh-CN: 命令行
categories:
- Guide
- guide
top: 99
---

View File

@ -1,8 +1,8 @@
---
title: Config
title_zh-CN: 配置
title_zh-CN: 基础配置
categories:
- Config
- config
end: false
top: 10
---

View File

@ -2,7 +2,7 @@
title_zh-CN: 容器
title: Container
categories:
- Guide
- guide
end: false
---

View File

@ -2,7 +2,7 @@
title: Components
title_zh-CN: 自定义组件
categories:
- Custom
- custom
end: false
---
@ -178,7 +178,7 @@ useScriptTag('//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
<template>
<YunFooter>
<!-- Customize footer content -->
<!-- customize footer content -->
<div>Total visits of this site <span id="busuanzi_value_site_pv" /></div>
<div>Number of visitors <span id="busuanzi_value_site_uv" /></div>
</YunFooter>

View File

@ -2,7 +2,7 @@
title: Custom Extensions
title_zh-CN: 自定义扩展
categories:
- Custom
- custom
end: false
---

View File

@ -2,7 +2,7 @@
title: Custom Styles
title_zh-CN: 自定义样式
categories:
- Custom
- custom
end: false
---

View File

@ -2,7 +2,7 @@
title: Custom Post Templates
title_zh-CN: 自定义文章模板
categories:
- Custom
- custom
end: false
---

View File

@ -2,7 +2,7 @@
title: Deployment
title_zh-CN: 部署
categories:
- Getting Started
- getting-started
end: false
top: 99
---

View File

@ -2,7 +2,7 @@
title: Features
title_zh-CN: 亮点
categories:
- Getting Started
- getting-started
end: false
top: 98
---

View File

@ -2,7 +2,7 @@
title: Getting Started
title_zh-CN: 开始
categories:
- Getting Started
- getting-started
end: true
top: 100
---

View File

@ -2,7 +2,7 @@
title: i18n in One Page
title_zh-CN: 单页 i18n
categories:
- Guide
- guide
---
::: tip

View File

@ -2,7 +2,7 @@
title: Page
title_zh-CN: 页面
categories:
- Guide
- guide
---
## FrontMatter

View File

@ -2,7 +2,7 @@
title: Post
title_zh-CN: 文章
categories:
- Guide
- guide
end: false
---

View File

@ -2,7 +2,7 @@
title: Third Party
title_zh-CN: 第三方集成
categories:
- Third
- third
end: false
top: 99
---

View File

@ -2,7 +2,7 @@
title: Schema.org for SEO
title_zh-CN: Schema.org for SEO
categories:
- Third
- third
top: 0
---

View File

@ -2,7 +2,7 @@
title: Use Vite/Vue Plugin
title_zh-CN: 使用 Vite/Vue 插件
categories:
- Third
- third
---
Valaxy 兼容 Vite/Vue 插件,你可以参考以下示例进行使用。

View File

@ -4,7 +4,7 @@ title: Why Valaxy
title_zh-CN: 为什么选 Valaxy
date: 2022-03-22
categories:
- Getting Started
- getting-started
tags:
- valaxy
- 笔记

View File

@ -9,10 +9,10 @@ hero:
tagline: Simple, powerful, and performant. Meet the modern BLOG framework you've always wanted.
actions:
- theme: brand
text: Get Started
text: button.get-started
link: /guide/getting-started
- theme: alt
text: View GitHub
text: button.view-github
link: https://github.com/YunYouJun/valaxy
# todo, rewrite with valaxy

View File

@ -2,7 +2,7 @@
title_zh-CN: 从 Hexo 迁移至 Valaxy
title: Migrate from Hexo to Valaxy
categories:
- Migration
- migration
end: true
top: 9
---

View File

@ -2,7 +2,7 @@
title: Migration from Other
title_zh-CN: 从其他博客框架迁移
categories:
- Migration
- migration
top: 10
---

View File

@ -2,7 +2,7 @@
title: Valaxy Themes Gallery
title_zh-CN: Valaxy 主题橱窗
categories:
- Theme
- theme
end: false
themes:

View File

@ -2,7 +2,7 @@
title: Use Theme
title_zh-CN: 使用主题
categories:
- Theme
- theme
top: 100
---

View File

@ -2,7 +2,7 @@
title: How to write a theme?
title_zh-CN: 如何编写一个 Valaxy 主题
categories:
- Theme
- theme
end: false
top: 50
---

View File

@ -35,56 +35,60 @@ export default defineValaxyConfig<PressTheme.Config>({
theme: 'press',
themeConfig: {
logo: '/favicon.svg',
sidebar: ['Getting Started', 'Guide', 'Config', 'Migration', 'built-ins', 'Third', 'Custom', 'Theme', 'Addon', 'Dev'],
sidebar: ['getting-started', 'guide', 'config', 'migration', 'built-ins', 'third', 'custom', 'theme', 'addon', 'dev'],
socialLinks: [
{ icon: 'i-ri-github-line', link: 'https://github.com/YunYouJun/valaxy' },
],
nav: [
{
text: 'Docs',
text: 'menu.guide',
items: [
{
text: 'Getting Started',
text: 'menu.getting-started',
link: '/guide/getting-started',
},
{
text: 'Migration from Other',
text: 'menu.migrate-from-other',
link: '/migration/',
},
],
},
{
text: 'Themes',
text: 'menu.theme',
items: [
{
text: 'Use Theme',
text: 'menu.use-a-theme',
link: '/themes/use',
},
{
text: 'Write A Theme',
text: 'menu.write-a-theme',
link: '/themes/write',
},
{
text: 'Themes Gallery',
text: 'menu.themes-gallery',
link: '/themes/gallery',
},
],
},
{
text: 'Addons',
text: 'menu.addon',
items: [
{
text: 'Why need addons?',
text: 'menu.why-need-addons',
link: '/addons',
},
{
text: 'Use A Addon',
text: 'menu.use-an-addon',
link: '/addons/use',
},
{
text: 'Write A Addon',
text: 'menu.write-an-addon',
link: '/addons/write',
},
{
text: 'menu.addons-gallery',
link: '/addons/gallery',
},
],
},
],

View File

@ -5,7 +5,7 @@ This is a theme for valaxy docs.
Inspired by [vitepress](https://vitepress.dev).
我开发此主题以编写 Valaxy 的初期文档,同时以便发现 valaxy 编写主题中的痛点。
它增加了 VitePress 一些所没有的功能,而随着 VitePress 的完善,该主题将不再被维护,文档也将在未来迁移至 VitePress。
<!-- 它增加了 VitePress 一些所没有的功能,而随着 VitePress 的完善,该主题将不再被维护,文档也将在未来迁移至 VitePress。 -->
- [预览](https://press.valaxy.site)

View File

@ -1,6 +1,8 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const props = defineProps<{
theme: 'brand' | 'alt'
link: string
@ -16,6 +18,8 @@ const classes = computed(() => {
return arr
})
const { t } = useI18n()
</script>
<template>
@ -26,6 +30,6 @@ const classes = computed(() => {
class="sese-btn btn rounded-full hover:shadow-lg" bg="gradient-to-r"
p="x-6"
>
{{ text }}
{{ t(text) }}
</AppLink>
</template>

View File

@ -35,7 +35,7 @@ function getTitle(post: Post | any) {
class="category-list-item inline-flex items-center justify-between"
>
<span class="category-name" font="bold" m="l-1" @click="displayCategory ? displayCategory(category.name) : null">
{{ category.name === 'Uncategorized' ? t('category.uncategorized') : category.name }}
{{ category.name === 'Uncategorized' ? t('category.uncategorized') : t(`category.${category.name}`) }}
<!-- <sup font="normal">[{{ category.total }}]</sup> -->
</span>
<span class="folder-action inline-flex cursor-pointer" opacity="50" @click="collapsable = !collapsable">

View File

@ -1,8 +1,11 @@
<script lang="ts" setup>
import { useFrontmatter } from 'valaxy'
import { useI18n } from 'vue-i18n'
import PressButton from './PressButton.vue'
const fm = useFrontmatter()
const { t } = useI18n()
</script>
<template>
@ -14,9 +17,9 @@ const fm = useFrontmatter()
</div>
<h2 m="b-10" text="center 6xl" font="black" leading="tight">
Next Generation
{{ t('banner.next-generation') }}
<br>
Static <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">Blog</span> Framework
{{ t('banner.static') }} <span class="gradient-text from-blue-500 to-purple-700" bg="gradient-to-r">{{ t('banner.blog') }}</span> {{ t('banner.framework') }}
</h2>
<div p="2" text="center">

View File

@ -1,5 +1,6 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
import type { NavItemGroup } from '../types'
defineProps<{
@ -7,6 +8,8 @@ defineProps<{
}>()
const open = ref(false)
const { t } = useI18n()
</script>
<template>
@ -23,14 +26,14 @@ const open = ref(false)
@click="open = !open"
>
<span class="text">
{{ item.text }}
{{ t(item.text) }}
</span>
<div i-ri-arrow-drop-down-line />
</button>
<div class="menu grow" flex="~ col" items="start">
<AppLink v-for="itemLink in item.items" :key="itemLink.text" class="menu-item" p="x-3" :to="itemLink.link">
{{ itemLink.text }}
{{ t(itemLink.text) }}
</AppLink>
</div>
</div>

View File

@ -5,10 +5,8 @@ import {
useOutline,
} from 'valaxy'
import { useI18n } from 'vue-i18n'
import { useThemeConfig } from '../composables'
const { t } = useI18n()
const themeConfig = useThemeConfig()
const container = ref()
const marker = ref()
@ -22,7 +20,7 @@ const { headers, handleClick } = useOutline()
<div v-show="headers.length" ref="container">
<div class="content">
<div class="outline-title">
{{ themeConfig.outlineTitle || t('sidebar.toc') }}
{{ t('theme.outlineTitle') }}
</div>
<div ref="marker" class="outline-marker" />

View File

@ -45,7 +45,7 @@ const localeTitle = computed(() => getLocaleTitle(locale.value, frontmatter.valu
<ValaxyMd class="prose mx-auto w-full max-w-4xl" :frontmatter="frontmatter">
<h1 v-if="hasSidebar && !isHome && frontmatter.title" :id="frontmatter.title" tabindex="-1">
{{ localeTitle }}
<a class="header-anchor" :href="`#${frontmatter.title}`" aria-hidden="true">#</a>
<a class="header-anchor" :href="`#${frontmatter.title}`" aria-hidden="true" />
</h1>
<slot name="main-content-md" />
<slot />

View File

@ -0,0 +1,4 @@
valaxy_theme_press: Valaxy Theme Press
theme:
outlineTitle: On this page

View File

@ -0,0 +1,4 @@
valaxy_theme_press: Valaxy 主题 Press
theme:
outlineTitle: 本页

View File

@ -3,12 +3,12 @@ import { nextTick } from 'vue'
import 'vitepress/dist/client/theme-default/styles/vars.css'
import 'vitepress/dist/client/theme-default/styles/base.css'
// import 'vitepress/dist/client/theme-default/styles/base.css'
// import 'vitepress/dist/client/theme-default/styles/utils.css'
// import 'vitepress/dist/client/theme-default/styles/components/vp-code.css'
// import 'vitepress/dist/client/theme-default/styles/components/vp-code-group.css'
import 'vitepress/dist/client/theme-default/styles/components/vp-doc.css'
import 'vitepress/dist/client/theme-default/styles/components/custom-block.css'
// import 'vitepress/dist/client/theme-default/styles/components/vp-sponsor.css'