mirror of https://github.com/YunYouJun/valaxy
docs: en translation (#186)
* docs: update i18n translation * docs: update deploy translation * docs: update getting-started translation * docs: update page translation * docs: update post translation * docs: update why translation * docs: update extend translations * docs: update config translation * docs: update commands translation * docs: use FrontMatter for searching * docs: update features translation
This commit is contained in:
parent
aa2938ef33
commit
4f9468f3ed
|
@ -6,7 +6,13 @@ categories:
|
|||
top: 99
|
||||
---
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 内置了辅助命令行,你可使用 `valaxy` 或缩写 `vala` 来执行以下命令。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Valaxy has a commandline tool. You can use `valaxy` or `vala` to execute the following commands.
|
||||
:::
|
||||
|
||||
```bash
|
||||
valaxy [args]
|
||||
|
@ -31,11 +37,21 @@ Options:
|
|||
-v, --version Show version number [boolean]
|
||||
```
|
||||
|
||||
## 使用
|
||||
## 使用 {lang="zh-CN"}
|
||||
|
||||
### 局部使用
|
||||
## Usage {lang="en"}
|
||||
|
||||
### 局部使用 {lang="zh-CN"}
|
||||
|
||||
### Local {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
你可以在项目的 `package.json` 中配置快捷脚本。(**推荐**)
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can configure shortcut scripts in `package.json`. (**Suggested**)
|
||||
:::
|
||||
|
||||
```json
|
||||
{
|
||||
|
@ -50,35 +66,86 @@ Options:
|
|||
}
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
譬如通过 `npm run dev` 启动项目,通过 `npm run build` 可以在构建生成 ssg 站点后,再构建 RSS 源。
|
||||
通过 `pnpm new post-title` 在 `posts` 文件夹下新建一个名为 `post-title` 的文章。
|
||||
:::
|
||||
|
||||
### 全局安装
|
||||
::: en
|
||||
For example, you can use `npm run dev` to run the project, use `npm run build` to build
|
||||
SSG site followed by building RSS source, and use `pnpm new post-title` to create a new
|
||||
post called `post-title` under the `posts` folder.
|
||||
:::
|
||||
|
||||
### 全局安装 {lang="zh-CN"}
|
||||
|
||||
### Global {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
你也可以全局安装 valaxy 以在全局使用 `valaxy` 命令。(**非必须**)
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can also install Valaxy globally to use `valaxy` command globally. (**Optional**)
|
||||
:::
|
||||
|
||||
```bash
|
||||
pnpm add -g valaxy
|
||||
```
|
||||
|
||||
## 常用命令
|
||||
## 常用命令 {lang="zh-CN"}
|
||||
|
||||
## Useful Commands {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- `valaxy .`: 启动 Valaxy,默认目录为当前目录(`.` 可不写)
|
||||
- `valaxy rss`: 自动生成 RSS
|
||||
- `valaxy build`: 默认采用 Vite 构建 SPA 应用
|
||||
- `valaxy build --ssg`: 使用 vite-ssg 构建静态页面站点(SEO 友好,推荐)
|
||||
|
||||
## 文章
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- `valaxy .`: Start Valaxy. The default directory is current directory. (`.` is optional)
|
||||
- `valaxy rss`: Generate RSS
|
||||
- `valaxy build`: Use Vite to build SPA app by default
|
||||
- `valaxy build --ssg`: Use vite-ssg to build static web page (SEO-friendly, recommended)
|
||||
|
||||
:::
|
||||
|
||||
## 文章 {lang="zh-CN"}
|
||||
|
||||
## Posts {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- `valaxy new <title>`: 在 `pages/posts` 目录下新建标题为 `title` 的帖子(.md)
|
||||
|
||||
譬如,`valaxy new your-first-post`,将会在 `pages/posts` 下自动新建 `your-first-post.md` 文件,并附带日期。
|
||||
|
||||
> 你觉得还可以有其他更常用、更好用的命令?没问题,尽管来 [Issues](https://github.com/YunYouJun/valaxy/issues) 反馈吧!
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- `valaxy new <title>`: Create a post (.md) titled `title` under the directory `pages/posts`.
|
||||
|
||||
For example, `valaxy new your-first-post` will create a file `your-first-post.md` under `pages/posts`,
|
||||
and update the date.
|
||||
|
||||
> Do you think you have other more useful or better commands? That's great! Please report that by creating
|
||||
> an issue at [GitHub Issues](https://github.com/YunYouJun/valaxy/issues)!
|
||||
:::
|
||||
|
||||
## FAQ
|
||||
|
||||
### 控制台开发时日志太少,构建时日志太多?
|
||||
### 控制台开发时日志太少,构建时日志太多? {lang="zh-CN"}
|
||||
|
||||
### More logs when developing and less when building? {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- 开发时(`valaxy`)默认日志等级为 `info`
|
||||
- 构件时(`valaxy build`)默认日志等级为 `warn`
|
||||
|
@ -86,3 +153,14 @@ pnpm add -g valaxy
|
|||
您可以通过设置日志等级控制。
|
||||
|
||||
譬如 `valaxy build --log=info`。
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- When developing (`valaxy`), the default log level is `info`
|
||||
- When building (`valaxy build`), the default log level is `warn`
|
||||
|
||||
You can use arguments to set the log level.
|
||||
|
||||
For example, `valaxy build --log=info`.
|
||||
:::
|
||||
|
|
|
@ -7,11 +7,14 @@ end: false
|
|||
top: 10
|
||||
---
|
||||
|
||||
## 配置说明
|
||||
## 配置说明 {lang="zh-CN"}
|
||||
|
||||
## Configurations {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
为了便于配置,Valaxy 将配置分为了三种。
|
||||
|
||||
`valaxy.config.ts` 是配置的主入口,。
|
||||
`valaxy.config.ts` 是配置的主入口。
|
||||
|
||||
- `siteConfig`: 站点**信息**配置,这部分内容面向站点展示且在任何主题也是通用的格式
|
||||
- `themeConfig`: 主题配置,这部分内容仅在特定主题生效
|
||||
|
@ -19,6 +22,20 @@ top: 10
|
|||
- 其他 Valaxy 通用配置内容(如需要在 Node 端处理的配置)
|
||||
|
||||
譬如:
|
||||
:::
|
||||
|
||||
::: en
|
||||
To simplify config, Valaxy divided the configuration into 3.
|
||||
|
||||
`valaxy.config.ts` is the main entry of configuration.
|
||||
|
||||
- `siteConfig`: Site **info** config. This affects info displayed on the site, and is independent of themes.
|
||||
- `themeConfig`: Theme config. This part is effective only when the specific theme is in use.
|
||||
- `runtimeConfig`: Runtime config (generated by Valaxy). You don't need to modify the config.
|
||||
- Other general Valaxy config (e.g., config that's needed for Node)
|
||||
|
||||
For example:
|
||||
:::
|
||||
|
||||
```ts
|
||||
// valaxy.config.ts
|
||||
|
@ -59,8 +76,11 @@ export default defineValaxyConfig<ThemeConfig>({
|
|||
})
|
||||
```
|
||||
|
||||
## Site Config
|
||||
## 站点配置 {lang="zh-CN"}
|
||||
|
||||
## Site Config {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
站点**信息**配置,这部分内容面向站点展示且在任何主题也是通用的格式。
|
||||
|
||||
你也可以将其写在 `site.config.ts` 中。
|
||||
|
@ -111,12 +131,71 @@ export default defineSiteConfig({
|
|||
})
|
||||
```
|
||||
|
||||
### 社交图标
|
||||
:::
|
||||
|
||||
::: en
|
||||
Site **info** config. This affects info displayed on the site, and is independent of themes.
|
||||
|
||||
You can also write it in `site.config.ts`.
|
||||
|
||||
For example:
|
||||
|
||||
```ts
|
||||
// site.config.ts
|
||||
import { defineSiteConfig } from 'valaxy'
|
||||
|
||||
export default defineSiteConfig({
|
||||
lang: 'zh-CN',
|
||||
title: 'Valaxy Theme Yun',
|
||||
url: 'https://valaxy.yyj.moe/',
|
||||
author: {
|
||||
name: 'Yunyoujun',
|
||||
avatar: 'https://www.yunyoujun.cn/images/avatar.jpg',
|
||||
},
|
||||
/**
|
||||
* Site favicon
|
||||
*/
|
||||
favicon: 'https://www.yunyoujun.cn/favicon.svg',
|
||||
/**
|
||||
* Subtitle
|
||||
*/
|
||||
subtitle: 'All at sea.',
|
||||
description: 'Valaxy Theme Yun Preview.',
|
||||
social: [
|
||||
{
|
||||
name: 'RSS',
|
||||
link: '/atom.xml',
|
||||
icon: 'i-ri-rss-line',
|
||||
color: 'orange',
|
||||
}
|
||||
],
|
||||
|
||||
sponsor: {
|
||||
enable: true,
|
||||
methods: [
|
||||
{
|
||||
name: 'Alipay',
|
||||
url: 'https://cdn.yunyoujun.cn/img/donate/alipay-qrcode.jpg',
|
||||
color: '#00A3EE',
|
||||
icon: 'i-ri-alipay-line',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### 社交图标 {lang="zh-CN"}
|
||||
|
||||
### Social Icons {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
```ts
|
||||
export interface SocialLink {
|
||||
/**
|
||||
* The title of your link
|
||||
* 社交链接名称
|
||||
*/
|
||||
name: string
|
||||
link: string
|
||||
|
@ -130,6 +209,28 @@ export interface SocialLink {
|
|||
```
|
||||
|
||||
示例:
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
```ts
|
||||
export interface SocialLink {
|
||||
/**
|
||||
* The title of your link
|
||||
*/
|
||||
name: string
|
||||
link: string
|
||||
/**
|
||||
* Icon name
|
||||
* https://icones.js.org/
|
||||
*/
|
||||
icon: string
|
||||
color: string
|
||||
}
|
||||
```
|
||||
|
||||
Example:
|
||||
:::
|
||||
|
||||
```ts
|
||||
// site.config.ts
|
||||
|
@ -158,8 +259,11 @@ export default defineSiteConfig({
|
|||
})
|
||||
```
|
||||
|
||||
### 赞助
|
||||
### 赞助 {lang="zh-CN"}
|
||||
|
||||
### Sponsor {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
> 在每篇文章末尾,展示赞助(打赏)信息。
|
||||
|
||||
```ts
|
||||
|
@ -187,6 +291,37 @@ export default defineSiteConfig({
|
|||
```
|
||||
|
||||
你可以通过 `sponsor` 属性控制全局是否开启。
|
||||
:::
|
||||
|
||||
::: en
|
||||
> At the end of each post, show sponsor information.
|
||||
|
||||
```ts
|
||||
// site.config.ts
|
||||
import { defineSiteConfig } from 'valaxy'
|
||||
export default defineSiteConfig({
|
||||
sponsor: {
|
||||
enable: true,
|
||||
methods: [
|
||||
{
|
||||
name: 'Alipay',
|
||||
url: 'https://cdn.yunyoujun.cn/img/donate/alipay-qrcode.jpg',
|
||||
color: '#00A3EE',
|
||||
icon: 'i-ri-alipay-line',
|
||||
},
|
||||
{
|
||||
name: 'WeChat Pay',
|
||||
url: 'https://cdn.yunyoujun.cn/img/donate/wechatpay-qrcode.jpg',
|
||||
color: '#2DC100',
|
||||
icon: 'i-ri-wechat-pay-line',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
You can use the `sponsor` property to globally toggle if it's shown.
|
||||
:::
|
||||
|
||||
```ts
|
||||
interface SponsorOption {
|
||||
|
@ -201,7 +336,13 @@ interface SponsorOption {
|
|||
}
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
或为某篇文章的 Front Matter 单独设置:
|
||||
:::
|
||||
|
||||
::: en
|
||||
Or you can set for each post using front matter:
|
||||
:::
|
||||
|
||||
```md
|
||||
---
|
||||
|
@ -210,6 +351,14 @@ sponsor: false
|
|||
---
|
||||
```
|
||||
|
||||
## Theme Config
|
||||
## 主题配置 {lang="zh-CN"}
|
||||
|
||||
## Theme Config {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
参照 [使用主题](/themes/use) 及您所使用的主题文档进行配置。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Please refer to [Using Themes](/themes/use) and the theme you are using to configure it.
|
||||
:::
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
---
|
||||
title: Extend
|
||||
title: Custom Extensions
|
||||
title_zh-CN: 自定义扩展
|
||||
categories:
|
||||
- Custom
|
||||
end: false
|
||||
---
|
||||
|
||||
Todo:
|
||||
|
||||
- [ ] English
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 以约定大于配置的方式提供了强大的扩展功能,如果你有一定开发经验,可以自定义控制站点的每一处细节。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Valaxy provides strong extensibility by "Convension over Configuration". If you have some development experience, you should be able to control every detail in the website.
|
||||
:::
|
||||
|
||||
<div lang="zh-CN">
|
||||
|
||||
> 以下内容无论对于用户还是主题开发者来说都同样适用。
|
||||
|
||||
|
@ -20,13 +24,37 @@ Valaxy 以约定大于配置的方式提供了强大的扩展功能,如果你
|
|||
如果你想要有所参考,你可以参见 [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun)。
|
||||
:::
|
||||
|
||||
## 自动布局注册
|
||||
</div>
|
||||
|
||||
<div lang="en">
|
||||
|
||||
> The following content applies to either users or theme developers.
|
||||
|
||||
::: tip
|
||||
By default, the operations are done in the root directory of the site or the theme.
|
||||
|
||||
If you want some reference, you can refer to [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun).
|
||||
:::
|
||||
|
||||
</div>
|
||||
|
||||
## 自动布局注册 {lang="zh-CN"}
|
||||
|
||||
## Automatic Layout Registration {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
基于 [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts),Valaxy 提供了布局功能。
|
||||
|
||||
新建 `layouts` 文件,书写 Vue 组件作为布局。
|
||||
|
||||
你可以在 Markdown 中如下使用它。
|
||||
:::
|
||||
|
||||
Valaxy provides custom layouts based on [vite-plugin-vue-layouts](https://github.com/JohnCampionJr/vite-plugin-vue-layouts).
|
||||
|
||||
Create a `layouts` file, and write Vue components as layouts.
|
||||
|
||||
You can use it in your Markdown as follows.
|
||||
|
||||
```md
|
||||
---
|
||||
|
@ -35,13 +63,29 @@ layout: album
|
|||
---
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
同样,当存在同名布局时,覆盖顺序为 `用户目录` -> `主题目录` -> `Valaxy 客户端目录`。
|
||||
:::
|
||||
|
||||
## 自定义 index.html
|
||||
::: en
|
||||
Likewise, when there are layouts with the same name, the order to use is `user directory` -> `theme directory` -> `Valaxy directory`.
|
||||
:::
|
||||
|
||||
## 自定义 index.html {lang="zh-CN"}
|
||||
|
||||
## Customizing index.html {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
新建 `index.html`,你可以在 `<head></head>` 与 `<body></body>` 全局地插入任意内容。
|
||||
|
||||
譬如:
|
||||
:::
|
||||
|
||||
::: en
|
||||
Create a new `index.html` file. You can globally insert anything in between `<head></head>` or `<body></body>` tags.
|
||||
|
||||
For example:
|
||||
:::
|
||||
|
||||
```html
|
||||
<head>
|
||||
|
@ -52,8 +96,11 @@ layout: album
|
|||
</head>
|
||||
```
|
||||
|
||||
## 扩展 Client 上下文
|
||||
## 扩展 Client 上下文 {lang="zh-CN"}
|
||||
|
||||
## Extending Client Context {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
新建 `setup/main.ts`:
|
||||
|
||||
```ts
|
||||
|
@ -68,15 +115,46 @@ export default defineAppSetup((ctx) => {
|
|||
```
|
||||
|
||||
> 具体示例可参见 [谷歌统计|第三方集成](/guide/third-party#谷歌统计)。
|
||||
:::
|
||||
|
||||
## 多语言支持
|
||||
::: en
|
||||
Create a new file `setup/main.ts`:
|
||||
|
||||
```ts
|
||||
import { defineAppSetup } from 'valaxy'
|
||||
|
||||
export default defineAppSetup((ctx) => {
|
||||
console.log(ctx)
|
||||
const { app, head, router, routes, isClient } = ctx
|
||||
// Use any Vue plugins
|
||||
app.use(/* */)
|
||||
})
|
||||
```
|
||||
|
||||
> For a detailed example, please see [Google Analytics | Third Party Integration](/guide/third-party#谷歌统计)。
|
||||
:::
|
||||
|
||||
## 多语言支持 {lang="zh-CN"}
|
||||
|
||||
## I18n {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
新建 `locales` 文件夹。
|
||||
|
||||
- `zh-CN.yml`: 中文翻译
|
||||
- `en.yml`: 英文翻译
|
||||
|
||||
譬如(请确保文件内容非空):
|
||||
:::
|
||||
|
||||
::: en
|
||||
Create `locales` folder.
|
||||
|
||||
- `zh-CN.yml`: Chinese translation
|
||||
- `en.yml`: English translation
|
||||
|
||||
For example (make sure that the file is not empty):
|
||||
:::
|
||||
|
||||
```yaml
|
||||
# en.yml
|
||||
|
@ -90,7 +168,13 @@ button:
|
|||
about: 关于
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
你可以如下方式使用它:
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can use it like this:
|
||||
:::
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
|
@ -105,25 +189,58 @@ const { t } = useI18n()
|
|||
</template>
|
||||
```
|
||||
|
||||
## 模版文件
|
||||
## 模版文件 {lang="zh-CN"}
|
||||
|
||||
## Template Files {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
新建某类布局 Markdown 文件的模版。(开发中)
|
||||
|
||||
新建 `scaffolds` 文件夹。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Create some templates for Markdown layout. (Work in progress)
|
||||
|
||||
Create `scaffolds` folder.
|
||||
:::
|
||||
|
||||
```bash
|
||||
valaxy new <title> -l [layout]
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- `layout`: 默认为 `post`
|
||||
|
||||
新建 `xxx.md`,xxx 取决于你的布局名称。
|
||||
譬如 `album.md` 代表 `layout: album`。
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- `layout`: Default is `post`
|
||||
|
||||
Create a new file `xxx.md`, where `xxx` is your layout name.
|
||||
For example, `album.md` represents `layout: album`.
|
||||
:::
|
||||
|
||||
```bash
|
||||
valaxy new my-young -l album
|
||||
```
|
||||
|
||||
## 其他
|
||||
## 其他 {lang="zh-CN"}
|
||||
|
||||
## Others {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- [自定义样式 | Valaxy](/guide/custom/styles)
|
||||
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- [Custom Styles | Valaxy](/guide/custom/styles)
|
||||
|
||||
:::
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Deploy
|
||||
title: Deployment
|
||||
title_zh-CN: 部署
|
||||
categories:
|
||||
- Getting Started
|
||||
|
@ -7,9 +7,19 @@ end: false
|
|||
top: 99
|
||||
---
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 的部署非常简单,我们推荐你直接通过第三方的 CI 构建并托管到任意平台。
|
||||
:::
|
||||
|
||||
### 自行部署
|
||||
::: en
|
||||
Deploying Valaxy is very easy. We suggest that you build and deploy to any platform using third party CI.
|
||||
:::
|
||||
|
||||
### 自行部署 {lang="zh-CN"}
|
||||
|
||||
### Manual Deployment {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
```bash
|
||||
# 构建打包
|
||||
|
@ -17,24 +27,64 @@ npm run build
|
|||
# dist 文件夹为构建后的内容
|
||||
```
|
||||
|
||||
### 第三方部署
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
```bash
|
||||
# Build the package
|
||||
npm run build
|
||||
# The `dist/` directory contains the artifact
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### 第三方部署 {lang="zh-CN"}
|
||||
|
||||
### Third Party Deployment {lang="en"}
|
||||
|
||||
#### GitHub Pages
|
||||
|
||||
::: zh-CN
|
||||
在使用 `pnpm create valaxy` 创建模版项目时,已内置文件[`.github/workflows/gh-pages.yml`](https://github.com/YunYouJun/valaxy/blob/main/packages/create-valaxy/template/.github/workflows/gh-pages.yml) 以实现 GitHub Actions 的自动部署工作流。
|
||||
|
||||
上传至 GitHub Repo,打开 `Settings` -> `Pages`,选择 `gh-pages` 分支。
|
||||
|
||||
选择 Github Repo,打开 `Settings`-> `Action` -> `General` -> `Workflow permissions`,选择 `read and write permissions`。
|
||||
选择 Github Repo,打开 `Settings`-> `Action` -> `General` -> `Workflow permissions`,选择 `read and write permissions`。
|
||||
|
||||
> `gh-pages` 已由 `.github/workflows/gh-pages.yml` 自动部署。
|
||||
:::
|
||||
|
||||
::: en
|
||||
When you use `pnpm create valaxy` to create a template project, it contains the file [`.github/workflows/gh-pages.yml`](https://github.com/YunYouJun/valaxy/blob/main/packages/create-valaxy/template/.github/workflows/gh-pages.yml) for the CI workflow of GitHub Actions.
|
||||
|
||||
Push to your GitHub repository, and go to `Settings` -> `Pages`. Select `gh-pages` branch.
|
||||
|
||||
Select the Github repository, go to `Settings`-> `Action` -> `General` -> `Workflow permissions`, and select `read and write permissions`。
|
||||
|
||||
> `gh-pages` has been automatically deployed by `.github/workflows/gh-pages.yml`.
|
||||
:::
|
||||
|
||||
#### Netlify
|
||||
|
||||
::: zh-CN
|
||||
已内置 `netlify.toml`.
|
||||
:::
|
||||
|
||||
#### 其他
|
||||
::: en
|
||||
`netlify.toml` is built-in.
|
||||
:::
|
||||
|
||||
#### 其他 {lang="zh-CN"}
|
||||
|
||||
#### Others {lang="en"}
|
||||
|
||||
TODO
|
||||
|
||||
::: zh-CN
|
||||
你还可以使用 [Vercel](https://vercel.com/)/[Render](https://render.com/)/[Cloudflare Pages](https://pages.cloudflare.com/) 等进行托管。
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can also use [Vercel](https://vercel.com/)/[Render](https://render.com/)/[Cloudflare Pages](https://pages.cloudflare.com/) to host your website.
|
||||
:::
|
||||
|
|
|
@ -7,22 +7,54 @@ end: false
|
|||
top: 98
|
||||
---
|
||||
|
||||
::: zh-CN
|
||||
首先,我们来介绍一下 Valaxy 有哪些便捷的特性。
|
||||
:::
|
||||
|
||||
## 热更新
|
||||
::: en
|
||||
First, I'll introduce you to some easy
|
||||
:::
|
||||
|
||||
## 热更新 {lang="zh-CN"}
|
||||
|
||||
## Hot Reloading {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
最值得一提的是,Valaxy 从配置到文章内容、动画到全局的标签、分类,全部都是支持热更新的!局部的!
|
||||
|
||||
譬如,你修改了 `valaxy.config.ts`/`site.config.ts` 或是 `xxx.md` 文章中的内容或 `frontmatter`(`tags`/`categories`)所有的变动会立刻显示在预览界面上,无需手动刷新。同时热更新也是局部的,它只变动有修改的地方,不会重新刷新整个页面。
|
||||
:::
|
||||
|
||||
## 自定义
|
||||
::: en
|
||||
It's most worth mentioning that Valaxy supports partial hot reloading, for configuration, post contents,
|
||||
animation, tags, categories, and much more!
|
||||
|
||||
For example, if you modified `valaxy.config.ts`/`site.config.ts`, the content in `xxx.md`, or `frontmatter`
|
||||
(`tags`/`categories`), all changes will immediately appear on the preview page, and there is no need for manual
|
||||
refreshing. Also, hot reloads are local, meaning that only the place modified will change, and other elements
|
||||
on the page will not be refreshed.
|
||||
:::
|
||||
|
||||
## 自定义 {lang="zh-CN"}
|
||||
|
||||
## Customization {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
强大的自定义能力,你可以如忒修斯之船一样组件粒度地继承定制主题与你的博客。
|
||||
|
||||
更多请参见 [自定义组件](/guide/custom/components)。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Valaxy provides powerful customization support. You can customize every component for your theme and blog
|
||||
just like the Ship of Theseus.
|
||||
|
||||
See more at [Customizing Components](/guide/custom/components).
|
||||
:::
|
||||
|
||||
## UnoCSS
|
||||
|
||||
::: zh-CN
|
||||
> 内置的类 TailwindCSS 的工具类(基于 [UnoCSS](https://github.com/unocss/unocss))。
|
||||
|
||||
如果你使用过 [TailwindCSS](https://tailwindcss.com/),那么一定能迅速领会到它的便捷之处。
|
||||
|
@ -44,9 +76,35 @@ top: 98
|
|||
<div class="bg-white text-blue shadow" p="4">
|
||||
这是一份 Markdown 内容。
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: en
|
||||
> The builtin TailwindCSS-like util class (based on [UnoCSS](https://github.com/unocss/unocss)).
|
||||
|
||||
If you have used [TailwindCSS](https://tailwindcss.com/) before, then you will rapidly learn it's convenience.
|
||||
|
||||
You can use it at will in your Markdown and Vue components, and it will finally get packaged by need and loaded.
|
||||
|
||||
For example:
|
||||
|
||||
```md
|
||||
This is markdown.
|
||||
|
||||
<div class="bg-white text-blue shadow" p="4">
|
||||
This is markdown.
|
||||
</div>
|
||||
```
|
||||
|
||||
You will get the effect immediately like this:
|
||||
|
||||
<div class="bg-white text-blue shadow" p="4">
|
||||
This is markdown.
|
||||
</div>
|
||||
:::
|
||||
|
||||
## Icones
|
||||
|
||||
::: zh-CN
|
||||
> 海量的图标
|
||||
|
||||
你可以任意使用 [Icones](https://icones.js.org/) 中可搜索到的任意图标。
|
||||
|
@ -63,28 +121,72 @@ npm i @iconify-json/collection
|
|||
```
|
||||
|
||||
被添加至 `config.unocss.safelist` 的图标名称将全部是热加载的!
|
||||
:::
|
||||
|
||||
::: en
|
||||
> Massive amount of icons
|
||||
|
||||
You can use any icons that are from [Icônes](https://icones.js.org/).
|
||||
|
||||
The naming rule is `i-${collection}-${name}`, e.g. `i-ri-home-line`.
|
||||
|
||||
The theme by default has [RemixIcon](https://github.com/Remix-Design/RemixIcon) installed.
|
||||
|
||||
If you need any icons from other collections, you can install yourself. For example:
|
||||
|
||||
```bash
|
||||
# `collection` is the name of the icon collection, e.g. @iconify-json/ri
|
||||
npm i @iconify-json/collection
|
||||
```
|
||||
|
||||
All icon names added to `config.unocss.safelist` will be ready for hot reloading.
|
||||
:::
|
||||
|
||||
## UI
|
||||
|
||||
### 代码高亮
|
||||
### 代码高亮 {lang="zh-CN"}
|
||||
|
||||
### Syntax Highlighting {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
基于 [Shiki](https://github.com/shikijs/shiki) 实现。
|
||||
Valaxy 支持 `vue` 等语法高亮,拷贝代码,高亮其中某一行。
|
||||
|
||||
譬如:
|
||||
:::
|
||||
|
||||
::: en
|
||||
Based on [Shiki](https://github.com/shikijs/shiki).
|
||||
Valaxy supports syntax highlighting for languages like `vue`, and also supports copying code and
|
||||
highlighting a particular line in the code block.
|
||||
|
||||
For example:
|
||||
:::
|
||||
|
||||
```js {2}
|
||||
const a = 1
|
||||
const b = a
|
||||
```
|
||||
|
||||
### 自定义主题色
|
||||
### 自定义主题色 {lang="zh-CN"}
|
||||
|
||||
### Custom Theme Color {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
你只需传入一个主题色,全局各处的色彩会动态进行计算得出最终的效果。
|
||||
|
||||
譬如我希望主题色是红色:
|
||||
|
||||
> `valaxy-theme-yun` 支持
|
||||
:::
|
||||
|
||||
::: en
|
||||
You only need to provide a theme color for the global color dynamics to work and show effect.
|
||||
|
||||
For example, if I want my theme color to be red:
|
||||
|
||||
> Supported by `valaxy-theme-yun`
|
||||
:::
|
||||
|
||||
```ts
|
||||
// valaxy.config.ts
|
||||
|
@ -97,24 +199,53 @@ export default {
|
|||
}
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
但不仅如此,其他主题同样可复用 Valaxy 默认提供的色彩及变量函数来快速构建自身。
|
||||
|
||||
> 更多请参见 [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun) 代码。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Even more, other themes can also re-use the default color dynamic functions provided by Valaxy
|
||||
to build their own.
|
||||
|
||||
> Please refer to code in [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-theme-yun) for more.
|
||||
:::
|
||||
|
||||
## File-based Routing {lang="en"}
|
||||
|
||||
## 基于文件的自动路由 {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
路由会自动遵循相同目录结构从当前路径中的 Vue 文件生成。更多请参考 [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages)。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Routes will be auto-generated for Vue files in this dir with the same file structure.
|
||||
Check out [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) for more details.
|
||||
:::
|
||||
|
||||
## 构建
|
||||
## 构建 {lang="zh-CN"}
|
||||
|
||||
## Building {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
同时支持 SPA 与 SSG 两种方案。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Supports SPA and SSG.
|
||||
:::
|
||||
|
||||
### SSG
|
||||
|
||||
::: zh-CN
|
||||
基于 [vite-ssg](https://github.com/antfu/vite-ssg) 实现
|
||||
:::
|
||||
|
||||
::: en
|
||||
Based on [vite-ssg](https://github.com/antfu/vite-ssg)
|
||||
:::
|
||||
|
||||
```bash
|
||||
# SSG
|
||||
|
@ -131,14 +262,29 @@ npm run build:spa
|
|||
|
||||
## SEO
|
||||
|
||||
::: zh-CN
|
||||
Valaxy 已经默认集成了 Open Graph 的 SEO 优化,您无需为此操心。
|
||||
但需要注意的是,对于许多搜索引擎来说,他们可能只青睐 SSG 的构建模式。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Valaxy by default has integrated SEO optimization by Open Graph, and you don't need to worry about that.
|
||||
Note that for many search engines, they like SSG builds more.
|
||||
:::
|
||||
|
||||
## RSS
|
||||
|
||||
::: zh-CN
|
||||
自带命令生成 RSS 订阅源。
|
||||
|
||||
> [RSS 是什么?](https://baike.baidu.com/item/rss/24470)
|
||||
:::
|
||||
|
||||
::: en
|
||||
Valaxy comes with a command to generate RSS feeds.
|
||||
|
||||
> [What is RSS?](https://en.wikipedia.org/wiki/RSS)
|
||||
:::
|
||||
|
||||
```bash
|
||||
npm run rss
|
||||
|
@ -149,7 +295,13 @@ npm run rss
|
|||
|
||||
## 单页 i18n {lang="zh-CN"}
|
||||
|
||||
More info see [i18n](/posts/i18n).
|
||||
::: zh-CN
|
||||
详情请见 [i18n](/posts/i18n)。
|
||||
:::
|
||||
|
||||
::: en
|
||||
For more info, see [i18n](/posts/i18n).
|
||||
:::
|
||||
|
||||
## KaTeX
|
||||
|
||||
|
@ -172,8 +324,27 @@ export default defineValaxyConfig({
|
|||
})
|
||||
```
|
||||
|
||||
- [KaTeX | 示例 - Example](/examples/katex)
|
||||
::: zh-CN
|
||||
|
||||
## 自动路由替换
|
||||
- [KaTeX | 示例](/examples/katex)
|
||||
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- [KaTeX | Examples](/examples/katex)
|
||||
|
||||
:::
|
||||
|
||||
## 自动路由替换 {lang="zh-CN"}
|
||||
|
||||
## Auto Route Replacing {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
当 Valaxy 检测到文章的 a 链接为站内链接时,会自动将其替换为 `RouterLink`,享受丝滑的动态切换吧!
|
||||
:::
|
||||
|
||||
::: en
|
||||
When Valaxy detects that an `a` hyperlink in a post is an intra-site link (relative link),
|
||||
it will automatically replace it with a `RouterLink`. Enjoy the dynamic page switching!
|
||||
:::
|
||||
|
|
|
@ -11,6 +11,8 @@ top: 100
|
|||
|
||||
## 总览 {lang="zh-CN"}
|
||||
|
||||
<div lang="zh-CN">
|
||||
|
||||
Valaxy (V + Galaxy)旨在成为下一代静态博客框架,提供更好的热更新与用户加载体验、更强大更便捷的自定义开发可能性。
|
||||
|
||||
你可以在 [为什么选 Valaxy](/guide/why) 中了解更多关于项目的设计初衷。
|
||||
|
@ -21,26 +23,64 @@ Valaxy 基于 [Vite](https://vitejs.dev/) 提供热更新与打包等功能,
|
|||
因此 Valaxy 兼容并可自由使用 Vite 与 Vue 生态的所有插件。
|
||||
:::
|
||||
|
||||
</div>
|
||||
|
||||
<div lang="en">
|
||||
|
||||
Valaxy (V + Galaxy) aims for the next generation static blog framework, providing better hot reloading and user loading experience, with easier and powerful customization support.
|
||||
|
||||
You can learn more about the original intensions for this project in [Why Valaxy](/guide/why).
|
||||
|
||||
::: tip
|
||||
Valaxy is based on [Vite](https://vitejs.dev/) to provide hot reloading and packaging, and based on [Vue](https://vuejs.org/) to realize client functionalities such as views (themes, custom components).
|
||||
|
||||
Therefore, Valaxy supports all extensions/plugins for Vite and Vue.
|
||||
:::
|
||||
|
||||
</div>
|
||||
|
||||
## Create a Valaxy Project {lang="en"}
|
||||
|
||||
## 创建 Valaxy 项目 {lang="zh-CN"}
|
||||
|
||||
::: en
|
||||
> Example: [yun.valaxy.site](https://yun.valaxy.site)
|
||||
:::
|
||||
|
||||
::: zh-CN
|
||||
> 示例: [yun.valaxy.site](https://yun.valaxy.site)
|
||||
:::
|
||||
|
||||
### Try it Online {lang="en"}
|
||||
|
||||
### 在线试用 {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
你可以通过 [StackBlitz](https://stackblitz.com/edit/valaxy) 在线试用 Valaxy(默认使用主题 [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/))。
|
||||
|
||||
[](https://stackblitz.com/edit/valaxy)
|
||||
|
||||
> 这是一个极简项目,您仅需一下几个文件,就可以快速搭建好你的博客!
|
||||
> 这是一个极简项目,您仅需以下几个文件,就可以快速搭建好你的博客!
|
||||
>
|
||||
> - `pages` 文件夹:存放页面/文章
|
||||
> - `valaxy.config.ts` Valaxy 配置文件
|
||||
> - `package.json` 记录依赖
|
||||
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can use [StackBlitz](https://stackblitz.com/edit/valaxy) to try Valaxy online (the default theme used is [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/)).
|
||||
|
||||
[](https://stackblitz.com/edit/valaxy)
|
||||
|
||||
> This is an extremely simple project. You only need the following files to rapidly build your own blog!
|
||||
>
|
||||
> - `pages` folder: storing the pages/posts
|
||||
> - `valaxy.config.ts`: Valaxy's configuration file
|
||||
> - `package.json`: dependencies
|
||||
:::
|
||||
|
||||
### Locally {lang="en"}
|
||||
|
||||
### 在本地创建 {lang="zh-CN"}
|
||||
|
@ -97,19 +137,37 @@ npm init valaxy
|
|||
pnpm create valaxy
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
跟随命令行提示完成创建!
|
||||
|
||||
> 默认使用主题 [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/),当然您也可以安装使用任意其他主题。
|
||||
> 本文档同样是一个 Valaxy 主题 [valaxy-theme-press](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-press/)。
|
||||
:::
|
||||
|
||||
::: en
|
||||
Follow the prompt in the commandline to complete the process!
|
||||
|
||||
> The default theme used is [valaxy-theme-yun](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/), but you can also install any other themes.
|
||||
> This documentation is also a Valaxy theme: [valaxy-theme-press](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-press/).
|
||||
:::
|
||||
|
||||
## Usage {lang="en"}
|
||||
|
||||
## 使用 {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
> 进入你创建好后的文件夹目录后,执行以下命令。
|
||||
> 譬如:`cd valaxy-blog`。
|
||||
|
||||
安装依赖:
|
||||
:::
|
||||
|
||||
::: en
|
||||
> Enter the folder for the Valaxy project you just created, and execute the following commands.
|
||||
> For example: `cd valaxy-blog`.
|
||||
|
||||
Install the dependencies:
|
||||
:::
|
||||
|
||||
```bash
|
||||
# install
|
||||
|
@ -117,7 +175,13 @@ npm i
|
|||
# or pnpm i
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
启动预览:
|
||||
:::
|
||||
|
||||
::: en
|
||||
Start a preview:
|
||||
:::
|
||||
|
||||
```bash
|
||||
# start
|
||||
|
@ -127,14 +191,17 @@ npm run dev
|
|||
|
||||
::: zh-CN
|
||||
博客创建完毕,查看本地 `http://localhost:4859/`,玩的开心!
|
||||
|
||||
- Valaxy 博客通用的配置可参见 [配置](/guide/config) 与 [自定义扩展](/guide/custom/extend)。
|
||||
- Valaxy 主题独有配置请参见对应主题文档。(Valaxy Theme Yun 主题文档编写中……)
|
||||
:::
|
||||
|
||||
::: en
|
||||
See `http://localhost:4859/`, have fun!
|
||||
:::
|
||||
|
||||
- Valaxy 博客通用的配置可参见 [配置](/guide/config) 与 [自定义扩展](/guide/custom/extend)。
|
||||
- Valaxy 主题独有配置请参见对应主题文档。(Valaxy Theme Yun 主题文档编写中……)
|
||||
- See [Config](/guide/config) and [Custom Extensions](/guide/custom/extend) for the general configuration for Valaxy blogs.
|
||||
- For configuring Valaxy themes, please see the documentation for the corresponding themes. (Docs for Valaxy Theme Yun is still work in progress)
|
||||
:::
|
||||
|
||||
### Config {lang="en"}
|
||||
|
||||
|
@ -152,13 +219,19 @@ Documentation is being improved!
|
|||
文档正在不断完善中!
|
||||
:::
|
||||
|
||||
## Deploy {lang="en"}
|
||||
## Deployment {lang="en"}
|
||||
|
||||
## 部署 {lang="zh-CN"}
|
||||
|
||||
部署可参见 <RouterLink to="/guide/deploy">部署|指南</RouterLink>。
|
||||
::: zh-CN
|
||||
部署可参见 [部署|指南](/guide/deploy)。
|
||||
:::
|
||||
|
||||
## Upgrade {lang="en"}
|
||||
::: en
|
||||
See [Deployment](/guide/deploy) for deployment guide.
|
||||
:::
|
||||
|
||||
## Upgrading {lang="en"}
|
||||
|
||||
## 升级 {lang="zh-CN"}
|
||||
|
||||
|
@ -172,14 +245,20 @@ npm i valaxy-theme-yun@latest
|
|||
|
||||
### pnpm
|
||||
|
||||
::: zh-CN
|
||||
> 你可以使用 pnpm 的交互升级命令。
|
||||
:::
|
||||
|
||||
::: en
|
||||
> You can use the interactive upgrade command provided by `pnpm`.
|
||||
:::
|
||||
|
||||
```bash
|
||||
# interactive upgrade
|
||||
pnpm up --latest -i
|
||||
```
|
||||
|
||||
## Structure {lang="en"}
|
||||
## Directory Structure {lang="en"}
|
||||
|
||||
## 目录结构 {lang="zh-CN"}
|
||||
|
||||
|
@ -218,7 +297,7 @@ In most cases, you only need to work in the `pages` folder.
|
|||
- `locales`: 自定义国际化关键词
|
||||
:::
|
||||
|
||||
### Other {lang="en"}
|
||||
### Others {lang="en"}
|
||||
|
||||
### 其他 {lang="zh-CN"}
|
||||
|
||||
|
@ -240,7 +319,7 @@ In most cases, you only need to work in the `pages` folder.
|
|||
|
||||
:::
|
||||
|
||||
## Theme {lang="en"}
|
||||
## Themes {lang="en"}
|
||||
|
||||
## 主题 {lang="zh-CN"}
|
||||
|
||||
|
|
|
@ -77,11 +77,21 @@ English
|
|||
:::
|
||||
```
|
||||
|
||||
## 目录 i18n
|
||||
## 标题 i18n {lang="zh-CN"}
|
||||
|
||||
当然,Valaxy 同样支持目录的 i18n。原理同上。
|
||||
## Title i18n {lang="en"}
|
||||
|
||||
::: zh-CN
|
||||
当然,Valaxy 同样支持标题的 i18n。原理同上。
|
||||
|
||||
你可以采用如下方式书写:
|
||||
:::
|
||||
|
||||
::: en
|
||||
Of course, Valaxy supports i18n on titles. Works the same as above.
|
||||
|
||||
You can write internationalized titles like this:
|
||||
:::
|
||||
|
||||
### 你好,世界 {lang="zh-CN"}
|
||||
|
||||
|
|
|
@ -5,9 +5,15 @@ categories:
|
|||
- Guide
|
||||
---
|
||||
|
||||
## Frontmatter
|
||||
## FrontMatter
|
||||
|
||||
::: zh-CN
|
||||
你可以使用 front-matter 定制页面属性。
|
||||
:::
|
||||
|
||||
::: en
|
||||
You can custom page by front-matter.
|
||||
:::
|
||||
|
||||
### titleTemplate
|
||||
|
||||
|
@ -18,9 +24,28 @@ titleTemplate: '%s - Valaxy'
|
|||
---
|
||||
```
|
||||
|
||||
You will get html title `Cool - Valaxy`.
|
||||
::: zh-CN
|
||||
这样可以使 HTML 标题变为 `Cool - Valaxy`。
|
||||
:::
|
||||
|
||||
### Other
|
||||
::: en
|
||||
You will get html title `Cool - Valaxy`.
|
||||
:::
|
||||
|
||||
### 其它 {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- `toc: false`: 隐藏目录
|
||||
- `aside: false`: 隐藏右侧文章导航栏
|
||||
|
||||
:::
|
||||
|
||||
### Other {lang="en"}
|
||||
|
||||
::: en
|
||||
|
||||
- `toc: false`: Hide TOC
|
||||
- `aside: false`: Hide Right Aside
|
||||
|
||||
:::
|
||||
|
|
|
@ -7,11 +7,19 @@ categories:
|
|||
|
||||
## FrontMatter
|
||||
|
||||
**文章**(`post`)继承自**页面**(`page`),因此**页面**中的 Frontmatter 通用被**文章**支持。
|
||||
::: zh-CN
|
||||
**文章**(`post`)继承自**页面**(`page`),因此**页面**中的 Front Matter 通用被**文章**支持。
|
||||
|
||||
> 单篇文章支持的配置项。
|
||||
|
||||
譬如:
|
||||
:::
|
||||
|
||||
::: en
|
||||
`post` is a descendant of `page`, so the front matter in **pages** are supported by **posts**.
|
||||
|
||||
For example:
|
||||
:::
|
||||
|
||||
```md
|
||||
---
|
||||
|
@ -20,6 +28,8 @@ hide: true
|
|||
---
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
|
||||
- `title`: 文章标题
|
||||
- `hide`: 你可以在文章头部添加 hide 属性,来临时隐藏某篇文章。(该文章仍然会被渲染)
|
||||
- `true` / `all`: 当设置为 `true` 或 `all` 时,该文章仍然会被渲染,你可以直接访问链接进行查看。但不会被显示在展示的文章卡片与归档中。
|
||||
|
@ -29,8 +39,24 @@ hide: true
|
|||
- `html`: 以 HTML 形式展示
|
||||
- `text`: 以纯文本形式展示(去除 HTML 标签)
|
||||
|
||||
## 摘要
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
||||
- `title`: Title of the article.
|
||||
- `hide`: Adding `hide` in the header allows you to hide the article temporarily. (The article will still be rendered)
|
||||
- `true` / `all`: When set to `true` or `all`, the article will be rendered, and you can view it by visiting the link directly. It will not be displayed in article cards or archives.
|
||||
- `index`: When set to `index`, it will be hidden only in the front page. It will still be displayed in archives. (You can use this for some notes unnecessary for the front page, but good for the archive for reference sometimes)
|
||||
- `excerpt_type`: The rendering type for the excerpt in the preview list (Used with `<!-- more -->`)
|
||||
- `md`: Display as original markdown
|
||||
- `html`: Display as HTML
|
||||
- `text`: Display as text (removing HTML tags)
|
||||
|
||||
:::
|
||||
|
||||
## 摘要 {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
你可以通过插入 `<!-- more -->` 的方式生成摘要(excerpt)。
|
||||
可通过设置 `excerpt_type` 设置摘要渲染类型。
|
||||
|
||||
|
@ -46,3 +72,26 @@ excerpt_type: text
|
|||
|
||||
这里是正文
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## Excerpt {lang="en"}
|
||||
|
||||
::: en
|
||||
You can insert `<!--more-->` to generate an excerpt.
|
||||
You can set the excerpt rendering type by setting `excerpt_type`.
|
||||
|
||||
```md
|
||||
---
|
||||
title: Hello
|
||||
excerpt_type: text
|
||||
---
|
||||
|
||||
This is the experpt
|
||||
|
||||
<!-- more -->
|
||||
|
||||
Here goes the body
|
||||
```
|
||||
|
||||
:::
|
||||
|
|
|
@ -26,6 +26,8 @@ Valaxy 的目标是成为新一代的静态博客框架/生成器。
|
|||
|
||||
## 为什么是 Valaxy? {lang="zh-CN"}
|
||||
|
||||
::: zh-CN
|
||||
|
||||
构想新一代静态博客框架/生成器。
|
||||
|
||||
<!-- more -->
|
||||
|
@ -36,10 +38,12 @@ Valaxy 的目标是成为新一代的静态博客框架/生成器。
|
|||
|
||||
我将会把 Valaxy 与现有的 Hexo(流行的静态博客框架)与 VitePress/VuePress(流行的静态站点生成器)进行对比,并阐述 Valaxy 的优势。
|
||||
|
||||
::: en
|
||||
:::
|
||||
|
||||
## Why Valaxy? {lang="en"}
|
||||
|
||||
::: en
|
||||
|
||||
Next Generation Static Blog Framework/Generator
|
||||
|
||||
<!-- more -->
|
||||
|
@ -85,13 +89,17 @@ Hot update for configuration, article.
|
|||
Instead of reloading pages like hexo
|
||||
:::
|
||||
|
||||
### Motivation
|
||||
### Motivation {lang="en"}
|
||||
|
||||
### 动机 {lang="zh-CN"}
|
||||
|
||||
- Slidev
|
||||
- VitePress
|
||||
- Vitesse
|
||||
|
||||
## Why not ...?
|
||||
## Why not ...? {lang="en"}
|
||||
|
||||
## 为什么不是……? {lang="zh-CN"}
|
||||
|
||||
### Hexo/Hugo
|
||||
|
||||
|
|
Loading…
Reference in New Issue