Skip to content

Commit 763bcc9

Browse files
authored
feat: Add Chinese language support (#291)
* docs(README): Update the list of websites using this theme - A new website, https://viazure.cc/, has been added to the list of websites using this theme in the README.md file. * feat(i18n): Added Chinese language support - New Chinese homepage, about page, and multiple article pages - Configured Chinese language settings and menu items - Added Chinese translation files - Optimized website structure to support multilingual functionality
1 parent fd47b24 commit 763bcc9

File tree

13 files changed

+539
-2
lines changed

13 files changed

+539
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ If you are using this theme for any website, feel free to list the website here.
281281
- <https://unixsec.io/>
282282
- <https://blog.crisweb.com/>
283283
- <https://jonblack.gg/>
284+
- <https://viazure.cc/>
284285

285286
## Support
286287

exampleSite/content/zh/_index.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: "首页"
3+
author : "Hugo Authors"
4+
---

exampleSite/content/zh/pages/about.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: 关于
3+
description: 'Hugo,世界上最快的网站构建框架'
4+
author: Hugo Authors
5+
---
6+
7+
Hugo 是用 Go 语言编写的开源静态网站生成器,遵循 [Apache Licence 2.0](https://github.com/gohugoio/hugo/blob/master/LICENSE) 许可证。Hugo 支持 TOML、YAML 和 JSON 数据文件类型,以及 Markdown 和 HTML 内容文件,并使用短代码来添加丰富的内容。其他显著功能包括分类法、多语言模式、图像处理、自定义输出格式、HTML/CSS/JS 压缩以及对 Sass SCSS 工作流的支持。
8+
9+
Hugo 使用了多种开源项目,包括:
10+
11+
* https://github.com/yuin/goldmark
12+
* https://github.com/alecthomas/chroma
13+
* https://github.com/muesli/smartcrop
14+
* https://github.com/spf13/cobra
15+
* https://github.com/spf13/viper
16+
17+
Hugo 非常适合博客、企业网站、创意作品集、在线杂志、单页应用程序,甚至是拥有数千页的网站。
18+
19+
Hugo 适合那些希望手动编写自己的网站,而不必担心设置复杂的运行时环境、依赖项和数据库的人。
20+
21+
使用 Hugo 构建的网站速度极快、安全性高,并且可以部署在任何地方,包括 AWS、GitHub Pages、Heroku、Netlify 以及任何其他托管提供商。
22+
23+
[GitHub](https://github.com/gohugoio) 上了解更多信息并参与贡献。
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
title: "文章"
3+
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Emoji 支持
3+
date: 2023-02-01
4+
author: Hugo Authors
5+
description: 在 Hugo 中使用 Emoji 的指南
6+
tags:
7+
- emoji
8+
---
9+
10+
在 Hugo 项目中有多种方式可以启用 Emoji。
11+
12+
<!--more-->
13+
14+
可以在模板中直接调用 [`emojify`](https://gohugo.io/functions/emojify/) 函数,或者使用 [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes)
15+
16+
要全局启用 Emoji,请在站点的 `hugo.toml` 中将 `enableEmoji` 设置为 `true`。您可以直接在内容文件中输入 Emoji 的简写代码,例如:
17+
18+
`:see_no_evil:` :see_no_evil: `:hear_no_evil:` :hear_no_evil: `:speak_no_evil:` :speak_no_evil:
19+
20+
:heart: Hugo! 😁
21+
22+
[Emoji 速查表](http://www.emoji-cheat-sheet.com/) 是一个非常有用的 Emoji 简写代码参考。
23+
24+
---
25+
26+
**注意:** 上述步骤启用了 Hugo 中的 Unicode 标准 Emoji 字符和序列,但这些字符的渲染效果取决于浏览器和平台。要为 Emoji 设置样式,您可以使用第三方 Emoji 字体或字体堆栈,例如:
27+
28+
{{< highlight css >}}
29+
.emoji {
30+
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
31+
}
32+
{{< /highlight >}}
33+
34+
{{< css.inline >}}
35+
36+
<style>
37+
.emojify {
38+
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
39+
font-size: 2rem;
40+
vertical-align: middle;
41+
}
42+
@media screen and (max-width:650px) {
43+
.nowrap {
44+
display: block;
45+
margin: 25px 0;
46+
}
47+
}
48+
</style>
49+
50+
{{< /css.inline >}}
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
title: Markdown 语法指南
3+
date: 2023-02-11
4+
author: Hugo Authors
5+
description: 展示基本 Markdown 语法和 HTML 元素格式化的示例文章。
6+
isStarred: true
7+
---
8+
9+
本文提供了 Hugo 内容文件中可以使用的 Markdown 语法示例,同时展示了 Hugo 主题中是否对基本 HTML 元素进行了 CSS 装饰。
10+
<!--more-->
11+
12+
## 标题
13+
14+
以下 HTML `<h1>``<h6>` 元素表示六个级别的标题。`<h1>` 是最高级别的标题,而 `<h6>` 是最低级别的标题。
15+
16+
# H1
17+
18+
## H2
19+
20+
### H3
21+
22+
#### H4
23+
24+
##### H5
25+
26+
###### H6
27+
28+
## 段落
29+
30+
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum, voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur, offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur, cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer sperchicium faceata tiustia prat.
31+
32+
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.
33+
34+
## 图片
35+
36+
您可以使用以下语法来包含图片。图片的路径应相对于 `index.md` 文件。
37+
38+
```markdown
39+
![Landscape](1.jpg)
40+
```
41+
42+
![Landscape](1.jpg)
43+
44+
您还可以包含来自外部来源的图片。
45+
46+
```markdown
47+
![Image](https://source.unsplash.com/random/600x400/?tech)
48+
```
49+
50+
![Image](https://source.unsplash.com/random/600x400/?tech)
51+
52+
## 引用
53+
54+
引用元素表示从其他来源引用的内容,可以选择包含引用来源,引用来源必须位于 `footer``cite` 元素中,还可以选择包含注释和缩写等内联更改。
55+
56+
### 无来源的引用
57+
58+
> 您可以在引用中使用 Markdown 语法,例如 **bold**, _italics_, [links](https://gohugo.io/), `code`
59+
60+
### 带来源的引用
61+
62+
> Don't communicate by sharing memory, share memory by communicating.<br>
63+
> — <cite>Rob Pike[^1]</cite>
64+
65+
[^1]: 上述引用摘自 Rob Pike 在 2015 年 11 月 18 日 Gopherfest 上的[演讲](https://www.youtube.com/watch?v=PAAkCSZUG1c)
66+
67+
## 表格
68+
69+
表格不是 Markdown 核心规范的一部分,但 Hugo 原生支持它们。
70+
71+
Name | Age
72+
--------|------
73+
Bob | 27
74+
Alice | 23
75+
76+
### 表格中的 Markdown
77+
78+
| Italics | Bold | Code |
79+
| -------- | -------- | ------ |
80+
| *italics* | **bold** | `code` |
81+
82+
## 代码块
83+
84+
### 使用反引号的代码块
85+
86+
```html
87+
<!doctype html>
88+
<html lang="en">
89+
<head>
90+
<meta charset="utf-8">
91+
<title>Example HTML5 Document</title>
92+
</head>
93+
<body>
94+
<p>Test</p>
95+
</body>
96+
</html>
97+
```
98+
99+
### 缩进四个空格的代码块
100+
101+
<!doctype html>
102+
<html lang="en">
103+
<head>
104+
<meta charset="utf-8">
105+
<title>Example HTML5 Document</title>
106+
</head>
107+
<body>
108+
<p>Test</p>
109+
</body>
110+
</html>
111+
112+
### 使用 Hugo 内置高亮短代码的代码块
113+
114+
{{< highlight html >}}
115+
<!doctype html>
116+
<html lang="en">
117+
<head>
118+
<meta charset="utf-8">
119+
<title>Example HTML5 Document</title>
120+
</head>
121+
<body>
122+
<p>Test</p>
123+
</body>
124+
</html>
125+
{{< /highlight >}}
126+
127+
### 内联代码
128+
129+
使用反引号在句子中引用 `variable`
130+
131+
## 列表类型
132+
133+
### 有序列表
134+
135+
1. First item
136+
2. Second item with some `code` in it
137+
3. Third item
138+
139+
### 无序列表
140+
141+
* List item
142+
* Another item with some `code` in it
143+
* And another item
144+
145+
### 嵌套列表
146+
147+
* Fruit
148+
* Apple
149+
* Orange
150+
* Banana
151+
* Dairy
152+
* Milk
153+
* Cheese
154+
155+
## 其他元素 — abbr, sub, sup, kbd, mark
156+
157+
<abbr title="Graphics Interchange Format">GIF</abbr> 是一种位图图像格式。
158+
159+
H<sub>2</sub>O
160+
161+
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
162+
163+
按下 <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd> 结束会话。
164+
165+
大多数 <mark>蝾螈</mark> 是夜行动物,捕食昆虫、蠕虫和其他小生物。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
author: Hugo Authors
3+
title: 数学排版 - 在博客文章中使用数学符号
4+
date: 2023-04-01
5+
description: KaTeX 设置简要指南
6+
math: true
7+
---
8+
9+
在 Hugo 项目中,可以通过使用 [第三方 JavaScript 库](https://github.com/hugo-sid/hugo-blog-awesome/blob/main/layouts/partials/helpers/katex.html) 来启用数学符号。
10+
11+
<!--more-->
12+
13+
在本示例中,我们将使用 [KaTeX](https://katex.org/)
14+
15+
- 要全局启用 KaTeX,请在项目的配置文件中将参数 `math` 设置为 `true`,如下所示。
16+
- `hugo.toml`
17+
```toml
18+
[params]
19+
math = true
20+
```
21+
- `hugo.yaml`
22+
```yaml
23+
params:
24+
math: true
25+
```
26+
- 要在每页基础上启用 KaTeX,请在 Markdown 内容文件的 Front Matter 中包含参数 `math: true`,如下所示。
27+
28+
```
29+
---
30+
math: true
31+
---
32+
```
33+
34+
**注意:** [支持的 TeX 函数](https://katex.org/docs/supported.html) 在线参考是一个有用的资源。
35+
36+
### 示例
37+
38+
- 块级数学公式:
39+
40+
$$
41+
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
42+
$$
43+
44+
- 行内数学公式:
45+
46+
这是一个行内多项式:$5x^2 + 2y -7$。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
author: Hugo Authors
3+
title: 占位文本
4+
date: 2023-02-07
5+
description: 一篇包含占位文本的文章
6+
---
7+
8+
Lorem est tota propiore conpellat pectoribus de pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
9+
10+
1. Exierant elisi ambit vivere dedere
11+
2. Duce pollice
12+
3. Eris modo
13+
4. Spargitque ferrea quos palude
14+
15+
Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria tractus malis.
16+
17+
1. Comas hunc haec pietate fetum procerum dixit
18+
2. Post torum vates letum Tiresia
19+
3. Flumen querellas
20+
4. Arcanaque montibus omnes
21+
5. Quidem et
22+
23+
# Vagus elidunt
24+
25+
<svg class="canon" xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="373" width="496"><g fill="none"><path stroke="#000" stroke-width=".75" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width=".75" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width=".75" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx=".75" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx=".75" ry="1.25"></ellipse></g></svg>
26+
27+
[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon)
28+
29+
## Mane refeci capiebant unda mulcebat
30+
31+
Victa caducifer, malo vulnere contra dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.
32+
33+
Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae vulnus haerentia iuste et exercebat, sui et.
34+
35+
Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**.
36+
37+
{{< css.inline >}}
38+
<style>
39+
.canon { background: white; width: 100%; height: auto; }
40+
</style>
41+
{{< /css.inline >}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
author: Hugo Authors
3+
title: 富内容
4+
date: 2023-02-09
5+
description: Hugo 短代码的简要介绍
6+
---
7+
8+
Hugo 提供了多个[内置短代码](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes)来支持富内容,同时还提供了[隐私配置](https://gohugo.io/about/hugo-and-gdpr/)和一组简单短代码,以实现各种社交媒体嵌入的静态和无 JS 版本。
9+
<!--more-->
10+
---
11+
12+
## YouTube 隐私增强短代码
13+
14+
{{< youtube ZJthWmvUzzc >}}
15+
16+
<br>
17+
18+
---
19+
20+
## Twitter 简单短代码
21+
22+
{{< twitter_simple user="DesignReviewed" id="1085870671291310081" >}}
23+
24+
<br>
25+
26+
---
27+
28+
## Vimeo 简单短代码
29+
30+
{{< vimeo_simple 48912912 >}}

0 commit comments

Comments
 (0)