forked from drowl87/hextra_mirror
chore(i18n): improve translations of zh-cn (#14)
This commit is contained in:
@ -7,7 +7,7 @@ sidebar:
|
||||
open: true
|
||||
---
|
||||
|
||||
探索以下部分以学习使用 Hextra 撰写内容:
|
||||
探索以下各节以学习如何使用 Hextra 编写内容:
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -15,8 +15,8 @@ sidebar:
|
||||
{{< card link="organize-files" title="目录结构" icon="document-duplicate" >}}
|
||||
{{< card link="configuration" title="配置" icon="adjustments" >}}
|
||||
{{< card link="markdown" title="Markdown" icon="markdown" >}}
|
||||
{{< card link="syntax-highlighting" title="代码高Liam和" icon="sparkles" >}}
|
||||
{{< card link="latex" title="LaTeX" icon="variable" >}}
|
||||
{{< card link="diagrams" title="Diagrams" icon="chart-square-bar" >}}
|
||||
{{< card link="shortcodes" title="Shortcodes" icon="template" >}}
|
||||
{{< card link="syntax-highlighting" title="代码高亮" icon="sparkles" >}}
|
||||
{{< card link="latex" title="LaTeX 公式" icon="variable" >}}
|
||||
{{< card link="diagrams" title="图表" icon="chart-square-bar" >}}
|
||||
{{< card link="shortcodes" title="短代码" icon="template" >}}
|
||||
{{< /cards >}}
|
||||
|
@ -3,16 +3,17 @@ title: 配置文件
|
||||
weight: 2
|
||||
---
|
||||
|
||||
Hugo 从 Hugo 网站根目录下的 `hugo.yaml` 读取配置.
|
||||
在配置文件中, 您可以配置站点的所有选项.
|
||||
你可以在 `exampleSite/hugo.yaml` 中找到此站点的配置文件作为开始.
|
||||
Hugo 从 Hugo 网站根目录下的 `hugo.yaml` 读取配置。
|
||||
在配置文件中,您可以配置站点的所有选项。
|
||||
你可以在 `exampleSite/hugo.yaml` 中找到此站点的配置文件作为开始。
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Navigation
|
||||
## 导航栏
|
||||
|
||||
### Menu
|
||||
### 菜单
|
||||
|
||||
右上角的菜单在配置文件的 `menu.main` 中配置:
|
||||
右上角的菜单在配置文件的 `menu.main` 中配置:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
menu:
|
||||
@ -62,18 +63,18 @@ menu:
|
||||
icon: github
|
||||
```
|
||||
|
||||
这些菜单项可以通过设置 `weight` 进行排序.
|
||||
这些菜单项可以通过设置 `weight` 进行排序。
|
||||
|
||||
## 侧边栏
|
||||
|
||||
### 主侧边栏
|
||||
|
||||
主侧边栏是自动从 `content` 目录结构生成的.
|
||||
有关更多详细信息,转至 [目录结构](/docs/guide/organize-files).
|
||||
主侧边栏是自动从 `content` 目录结构生成的。
|
||||
有关更多详细信息,转至 [目录结构](/docs/guide/organize-files)。
|
||||
|
||||
### 额外链接
|
||||
|
||||
侧边栏的额外链接在配置文件的 `menu.sidebar` 部分中配置:
|
||||
侧边栏的额外链接在配置文件的 `menu.sidebar` 部分中配置:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
menu:
|
||||
@ -94,7 +95,7 @@ menu:
|
||||
|
||||
### 目录
|
||||
|
||||
目录是根据内容文件中的标题自动生成的, 可以在 `front matter` 设置 `toc:false` 来禁用它.
|
||||
目录是根据内容文件中的标题自动生成的,可以在 `front matter` 设置 `toc:false` 来禁用它。
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
---
|
||||
@ -105,15 +106,15 @@ toc: false
|
||||
|
||||
### 编辑此页链接
|
||||
|
||||
要配置编辑此页链接, 我们可以在配置文件中设置 `params.editURL.base`:
|
||||
要配置编辑此页链接,我们可以在配置文件中设置 `params.editURL.base`:
|
||||
```yaml {filename="hugo.yaml"}
|
||||
params:
|
||||
editURL:
|
||||
base: "https://github.com/your-username/your-repo/edit/main"
|
||||
```
|
||||
|
||||
将为每个页面自动生成编辑链接.
|
||||
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `params.editURL`:
|
||||
将为每个页面自动生成编辑链接。
|
||||
如需为特定页面设置编辑链接,可以在页面的 `front matter` 中设置 `params.editURL`:
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
---
|
||||
|
@ -1,18 +1,18 @@
|
||||
---
|
||||
title: Diagrams
|
||||
title: 图表
|
||||
weight: 6
|
||||
next: /docs/guide/shortcodes
|
||||
---
|
||||
|
||||
目前, Hextra 支持 [Mermain](#mermaid) 的图表.
|
||||
目前,Hextra 支持 [Mermain](#mermaid) 的图表。
|
||||
|
||||
<!--more-->
|
||||
|
||||
## Mermaid
|
||||
|
||||
[Mermaid](https://github.com/mermaid-js/mermaid#readme) 是一个基于 JavaScript 的图表绘制工具, 它的文本定义和 Markdown 类似, 可在浏览器中动态创建图表. 例如, 流程图、序列图、饼图等
|
||||
[Mermaid](https://github.com/mermaid-js/mermaid#readme) 是一个基于 JavaScript 的图表绘制工具,它的文本定义和 Markdown 类似,可在浏览器中动态创建图表。例如:流程图、序列图、饼图等。
|
||||
|
||||
在 Hextra 中使用 Mermain 就像使用代码块一样简单:
|
||||
在 Hextra 中使用 Mermain 就像使用代码块一样简单:
|
||||
|
||||
````markdown
|
||||
```mermaid
|
||||
@ -24,7 +24,7 @@ graph TD;
|
||||
```
|
||||
````
|
||||
|
||||
将呈现为:
|
||||
将呈现为:
|
||||
|
||||
```mermaid
|
||||
graph TD;
|
||||
@ -34,7 +34,7 @@ graph TD;
|
||||
C-->D;
|
||||
```
|
||||
|
||||
Sequence diagram:
|
||||
Sequence diagram:
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
@ -50,4 +50,4 @@ sequenceDiagram
|
||||
Bob-->>John: Jolly good!
|
||||
```
|
||||
|
||||
如需获取更多信息, 转至 [Mermaid Documentation](https://mermaid-js.github.io/mermaid/#/).
|
||||
如需获取更多信息,转至 [Mermaid Documentation](https://mermaid-js.github.io/mermaid/#/)。
|
||||
|
@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "LaTeX"
|
||||
title: "LaTeX 公式"
|
||||
weight: 4
|
||||
math: true
|
||||
---
|
||||
|
||||
$\KaTeX$ 用于呈现 LaTeX 数学表达式. 可在 `front matter` 将 `math` 设置为 `true` 来启用.
|
||||
$\KaTeX$ 用于呈现 LaTeX 数学表达式。可在 `frontmatter` 将 `math` 设置为 `true` 来启用。
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -13,16 +13,15 @@ $\KaTeX$ 用于呈现 LaTeX 数学表达式. 可在 `front matter` 将 `math`
|
||||
title: "My Page with LaTeX"
|
||||
math: true
|
||||
---
|
||||
|
||||
```
|
||||
|
||||
启用后, KaTeX 中的脚本, 样式表和字体将自动包含在你的网站中. 这样就可以在 Markdown 内容中使用 LaTeX 数学表达式.
|
||||
启用后,KaTeX 中的脚本,样式表和字体将自动包含在你的网站中。这样就可以在 Markdown 内容中使用 LaTeX 数学表达式。
|
||||
|
||||
## 例
|
||||
## 示例
|
||||
|
||||
Markdown 内容中支持内联和单独的 LaTeX 数学表达式.
|
||||
Markdown 内容支持行内和独立段落的 LaTeX 数学表达式。
|
||||
|
||||
### 内联
|
||||
### 行内
|
||||
|
||||
```markdown {filename="page.md"}
|
||||
This $\sigma(z) = \frac{1}{1 + e^{-z}}$ is inline.
|
||||
@ -30,28 +29,28 @@ This $\sigma(z) = \frac{1}{1 + e^{-z}}$ is inline.
|
||||
|
||||
This $\sigma(z) = \frac{1}{1 + e^{-z}}$ is inline.
|
||||
|
||||
### 单独的
|
||||
### 独立段落
|
||||
|
||||
```markdown {filename="page.md"}
|
||||
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
|
||||
```
|
||||
|
||||
will be rendered as:
|
||||
将被渲染为:
|
||||
|
||||
$$F(\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t} \, dt$$
|
||||
|
||||
|
||||
## 支持的功能
|
||||
|
||||
有关支持的函数列表, 转至 [KaTeX supported functions](https://katex.org/docs/supported.html).
|
||||
有关支持的符号列表,转至 [KaTeX 支持的公式](https://katex.org/docs/supported.html)。
|
||||
|
||||
## 化学表达式
|
||||
|
||||
通过 [mhchem](https://mhchem.github.io/MathJax-mhchem/) 支持化学表达式。
|
||||
|
||||
内联: $\ce{H2O}$ is water.
|
||||
行内:$\ce{H2O}$ 是水。
|
||||
|
||||
单独的:
|
||||
独立段落:
|
||||
|
||||
```markdown {filename="page.md"}
|
||||
$$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$$
|
||||
|
@ -3,7 +3,7 @@ title: Markdown
|
||||
weight: 2
|
||||
---
|
||||
|
||||
Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容, 创建列表等. 本页将向你展示一些最常见的 Markdown 语法示例.
|
||||
Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容,创建列表等。本页将向你展示一些最常见的 Markdown 语法示例。
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -21,7 +21,7 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容,
|
||||
|
||||
### 引用
|
||||
|
||||
带角标的块引用:
|
||||
带角标的块引用:
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.<br>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
@ -30,7 +30,7 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容,
|
||||
|
||||
### 表格
|
||||
|
||||
表格并非核心 Markdown 规范, 但 Hugo 支持开箱即用的表格:
|
||||
表格并非核心 Markdown 规范,但 Hugo 支持开箱即用的表格:
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
@ -73,19 +73,18 @@ Hugo 支持 [Markdown](https://en.wikipedia.org/wiki/Markdown) 来书写内容,
|
||||
* Milk
|
||||
* Cheese
|
||||
|
||||
### 图像
|
||||
### 图片
|
||||
|
||||

|
||||
|
||||
With caption:
|
||||
带有标题:
|
||||
|
||||

|
||||
|
||||
## 配置
|
||||
|
||||
Hugo 使用 [Goldmark](https://github.com/yuin/goldmark) 解析 Markdown.
|
||||
Markdown 渲染可以在 `hugo.yaml` 中的 `markup.goldmark` 中配置.
|
||||
以下是Hextra的默认配置:
|
||||
Hugo 使用 [Goldmark](https://github.com/yuin/goldmark) 解析 Markdown。
|
||||
Markdown 渲染可以在 `hugo.yaml` 中的 `markup.goldmark` 中配置。以下是Hextra的默认配置:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
markup:
|
||||
@ -96,7 +95,7 @@ markup:
|
||||
noClasses: false
|
||||
```
|
||||
|
||||
如需了解更多选项, 转至 [Configure Markup](https://gohugo.io/getting-started/configuration-markup/).
|
||||
如需了解更多选项,转至 [Configure Markup](https://gohugo.io/getting-started/configuration-markup/)。
|
||||
|
||||
## 参考资料
|
||||
|
||||
|
@ -6,8 +6,8 @@ prev: /docs/guide
|
||||
|
||||
## 目录结构
|
||||
|
||||
默认情况下,Hugo 在 `context` 目录中搜索 Markdown 文件, 目录的结构决定了网站的最终输出结构.
|
||||
以示例网站为例:
|
||||
默认情况下,Hugo 在 `context` 目录中搜索 Markdown 文件,目录的结构决定了网站的最终输出结构。
|
||||
以示例网站为例:
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -29,7 +29,7 @@ prev: /docs/guide
|
||||
{{< /filetree/folder >}}
|
||||
{{< /filetree/container >}}
|
||||
|
||||
每个 `_index.md` 文件都是相应部分的索引页, 其他 Markdown 文件则是常规页面.
|
||||
每个 `_index.md` 文件都是相应部分的索引页,其他 Markdown 文件则是常规页面。
|
||||
|
||||
```
|
||||
content
|
||||
@ -47,7 +47,7 @@ content
|
||||
|
||||
## 侧边栏导航
|
||||
|
||||
侧边栏导航是根据内容组织的字母顺序自动生成的. 要手动配置侧边栏顺序, 可以在 Markdown 文件的 `front matter ` 中使用 `weight` 配置.
|
||||
侧边栏导航是根据内容组织的字母顺序自动生成的。要手动配置侧边栏顺序,可以在 Markdown 文件的 `frontmatter ` 中使用 `weight` 配置。
|
||||
|
||||
```yaml {filename="content/docs/guide/_index.md"}
|
||||
---
|
||||
@ -57,9 +57,9 @@ weight: 2
|
||||
```
|
||||
|
||||
{{< callout emoji="ℹ️">}}
|
||||
建议侧边栏不要太深. 如果内容太多, 请考虑 **将它们分成多个部分**.
|
||||
建议侧边栏不要太深。如果内容太多,请考虑 **将它们分成多个部分**。
|
||||
{{< /callout >}}
|
||||
|
||||
## 配置 `context` 目录
|
||||
## 配置内容目录
|
||||
|
||||
如果需要为的内容使用不同的目录, 可以在站点配置文件中设置 [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) 来实现.
|
||||
如果需要为的内容使用不同的目录,可以在站点配置文件中设置 [`contentDir`](https://gohugo.io/getting-started/configuration/#contentdir) 来实现。
|
||||
|
19
exampleSite/content/docs/guide/shortcodes/_index.zh-cn.md
Normal file
19
exampleSite/content/docs/guide/shortcodes/_index.zh-cn.md
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
title: 短代码
|
||||
weight: 9
|
||||
prev: /docs/guide/diagrams
|
||||
next: /docs/guide/shortcodes/callout
|
||||
---
|
||||
|
||||
[Hugo 短代码](https://gohugo.io/content-management/shortcodes/) 是你的内容文件中调用内置或自定义模板的简单片段。
|
||||
|
||||
Hextra 提供了一系列美观的短代码以增强你的内容。
|
||||
|
||||
{{< cards >}}
|
||||
{{< card link="callout" title="注意事项" icon="warning" >}}
|
||||
{{< card link="cards" title="卡片" icon="card" >}}
|
||||
{{< card link="filetree" title="文件树" icon="folder-tree" >}}
|
||||
{{< card link="icon" title="图标" icon="badge-check" >}}
|
||||
{{< card link="steps" title="步骤" icon="one" >}}
|
||||
{{< card link="tabs" title="标签" icon="collection" >}}
|
||||
{{< /cards >}}
|
@ -3,8 +3,8 @@ title: "代码高亮"
|
||||
weight: 3
|
||||
---
|
||||
|
||||
Hugo 使用 [Chroma](https://github.com/alecthomas/chroma),一种纯 Golang 实现的代码高亮渲染器.
|
||||
建议对 Markdown 内容中的代码块使用反引号. 例如:
|
||||
Hugo 使用 [Chroma](https://github.com/alecthomas/chroma),一种纯 Golang 实现的代码高亮渲染器。
|
||||
建议对 Markdown 内容中的代码块使用反引号,例如:
|
||||
|
||||
<!--more-->
|
||||
|
||||
@ -26,7 +26,7 @@ def say_hello():
|
||||
|
||||
### 文件名
|
||||
|
||||
要向代码块添加文件名或标题, 请设置 `filename`:
|
||||
要向代码块添加文件名或标题,请设置 `filename`:
|
||||
|
||||
````markdown {filename="Markdown"}
|
||||
```python {filename="hello.py"}
|
||||
@ -42,7 +42,7 @@ def say_hello():
|
||||
|
||||
### 行号
|
||||
|
||||
如需设置行号, 将 `linenos` 设置为 `table` , 并将 `linenostart` 设置为起始行号:
|
||||
如需设置行号,将 `linenos` 设置为 `table`,并将 `linenostart` 设置为起始行号:
|
||||
|
||||
````markdown {filename="Markdown"}
|
||||
```python {linenos=table,linenostart=42}
|
||||
@ -56,9 +56,9 @@ def say_hello():
|
||||
print("Hello!")
|
||||
```
|
||||
|
||||
### 突出显示线条
|
||||
### 高亮行
|
||||
|
||||
要突出显示线条, 设置 `hl_lines` 为行号:
|
||||
显示高亮行,设置 `hl_lines` 为行号:
|
||||
|
||||
````markdown {filename="Markdown"}
|
||||
```python {linenos=table,hl_lines=[2,4],linenostart=1,filename="hello.py"}
|
||||
@ -81,9 +81,9 @@ def main():
|
||||
|
||||
### 复制按钮
|
||||
|
||||
默认情况下, 为代码块启用复制按钮.
|
||||
默认情况下,代码块复制按钮已自动启用。
|
||||
|
||||
|
||||
## 支持的语言
|
||||
## 支持的编程语言
|
||||
|
||||
如需了解支持的语言, 转至 [Chroma's documentation](https://github.com/alecthomas/chroma#supported-languages).
|
||||
如需了解支持的编程语言,转至 [Chroma's documentation](https://github.com/alecthomas/chroma#supported-languages)。
|
||||
|
Reference in New Issue
Block a user