Skip to content

Commit

Permalink
chore: add more l10n pages for example site
Browse files Browse the repository at this point in the history
  • Loading branch information
tomowang committed Mar 9, 2024
1 parent bc00e62 commit 3609ec8
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 2 deletions.
File renamed without changes.
46 changes: 46 additions & 0 deletions exampleSite/content/post/emoji-support/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
+++
author = "Hugo Authors"
title = "Emoji 支持"
date = "2019-03-05"
description = "在Hugo中使用Emoji的指引"
tags = [
"emoji",
]
+++

可以在一个 Hugo 项目中通过多种方式启用 Emoji。
<!--more-->
[`emojify`](https://gohugo.io/functions/emojify/) 函数可以被直接在模板或 [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes) 中调用。

若要全局启用 emoji,在你的网站的 [配置](https://gohugo.io/getting-started/configuration/) 中将 `enableEmoji` 设置为 `true`,然后你就可以直接在内容文件中输入 emoji 的简写代码;例如:

<p><span class="nowrap"><span class="emojify">🙈</span> <code>:see_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙉</span> <code>:hear_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙊</span> <code>:speak_no_evil:</code></span></p>
<br>

[Emoji 速查表](http://www.emoji-cheat-sheet.com/) 是 emoji 简写代码的有用参考。

***

**** 上述步骤可以在 Hugo 中启用 Unicode 标准的 emoji 字符和序列,但是这些字形的呈现取决于浏览器和平台。要给 emoji 设置样式,你可以使用第三方 emoji 字体或字体堆栈;例如:

{{< highlight html >}}
.emoji {
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
}
{{< /highlight >}}

{{< css.inline >}}
<style>
.emojify {
font-family: Apple Color Emoji, Segoe UI Emoji, NotoColorEmoji, Segoe UI Symbol, Android Emoji, EmojiSymbols;
font-size: 2rem;
vertical-align: middle;
}
@media screen and (max-width:650px) {
.nowrap {
display: block;
margin: 25px 0;
}
}
</style>
{{< /css.inline >}}
12 changes: 12 additions & 0 deletions exampleSite/content/post/image-process/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
+++
author = "Hugo Authors"
title = "图片处理"
date = "2023-12-01"
description = "关于Hugo中图片处理的示例"
tags = []
toc = false
+++

![Photo by Behnam Norouzi on Unsplash](./images/behnam-norouzi-_1ok63FFlM4-unsplash.jpg "Photo by Behnam Norouzi on Unsplash")

![placeholder](https://placeholder.co/1024x768/png "Test for external image")
File renamed without changes.
157 changes: 157 additions & 0 deletions exampleSite/content/post/markdown-syntax/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
+++
author = "Hugo Authors"
title = "Markdown语法指导"
date = "2019-03-11"
description = "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
tags = [
"markdown",
"css",
"html",
"tag1",
"tag2",
]
categories = [
"themes",
"syntax",
]
series = ["Themes Guide"]
aliases = ["migrate-from-jekyl"]
+++

本文档提供可用于 Hugo 内容文件的基本 Markdown 语法示例,并且还展示了 Hugo 主题中是否用 CSS 修饰了 HTML 基本元素。
<!--more-->

## 标题

以下 HTML `<h1>`-`<h6>` 元素表示六个级别的分节标题。 `<h1>` 是最高级别分节标题,而 `<h6>` 是最低级别分节标题。

# H1
## H2
### H3
#### H4
##### H5
###### H6

## 段落

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.

Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is sinveli squiatum, core et que aut hariosam ex eat.

## 块引用

blockquote 元素表示从另一个资源引用的内容,可能带有一个在 `footer``cite` 元素内的引用,或者带有诸如注释和缩写之类的行内更改。

### 没有归属的块引用

> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
> **请注意**在代码块中可以使用 *Markdown 语法*
### 带有归属的块引用

> 不要通过共享内存进行通信,而是通过通信共享内存。<br>
> - <cite>Rob Pike[^1]</cite>
[^1] 上述引用摘自 Rob Pike 于 2015 年 11 月 18 日在 Gopherfest 期间进行的 [演讲](https://www.youtube.com/watch?v=PAAkCSZUG1c)

## 表格

表格不是核心 Markdown 规范的一部分,但 Hugo 开箱即用地支持表格。

| Name | Age
| ------ | ------ |
| Bob | 27
| Alice | 23

### 表格中的行内 Markdown

| 斜体 | 粗体 | 代码 |
| ------ | ------ | ------ |
| *斜体* | **粗体** | `代码` |

## 代码块

### 带反引号的代码块

```html {linenos=true}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
```

### 用四个空格缩进的代码块

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>

### 带有 Hugo 内部高亮短代码的代码块

{{< highlight html >}}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example HTML5 Document</title>
</head>
<body>
<p>Test</p>
</body>
</html>
{{< /highlight >}}

## 列表类型

### 有序列表

1. 第一个项目
2. 第二个项目
3. 第三个项目

### 无序列表

* 项目一
* 项目二
* 项目三

### 嵌套列表

* 水果
* 苹果
* 橙子
* 香蕉
* 乳制品
* 牛奶
* 奶酪

### 带有复选框的列表

- [x] 创建 Hugo 网站
- [x] 添加内容
- [ ] 添加样式

## 其他元素 - abbr、sub、sup、kbd、mark

<abbr title="图形交换格式">GIF</abbr> 是一种位图图像格式。

H<sub>2</sub>O

X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>

按 <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> 结束会话。

大多数 <mark>火蜥蜴</mark> 在夜间活动,并捕食昆虫、蠕虫和其他小型生物。
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In this example we will be using [KaTeX](https://katex.org/)

- Create a partial under `/layouts/partials/math.html`
- Within this partial reference the [Auto-render Extension](https://katex.org/docs/autorender.html) or host these scripts locally.
- Include the partial in your templates like so:
- Include the partial in your templates like so:

```bash
{{ if or .Params.math .Site.Params.math }}
Expand Down Expand Up @@ -45,5 +45,5 @@ Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
Block math:
$$
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
\varphi = 1+\frac{1} {1+\frac{1} {1+\frac{1} {1+\cdots} } }
$$
49 changes: 49 additions & 0 deletions exampleSite/content/post/math-typesetting/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
author: Hugo Authors
title: 数学符号
date: 2019-03-08
description: KaTeX 设置简要指南
math: true
---

在 Hugo 项目中,可以通过使用第三方 JavaScript 库来启用数学符号。
<!--more-->

在本示例中,我们将使用 [KaTeX](https://katex.org/)

-`/layouts/partials/math.html` 下创建一个局部文件
- 在此局部文件中引用 [自动渲染扩展名](https://katex.org/docs/autorender.html) 或在本地托管这些脚本。
- 以以下方式在模板中包含局部文件:

```bash
{{ if or .Params.math .Site.Params.math }}
{{ partial "math.html" . }}
{{ end }}
```
- 要在全局启用 KaTeX,请在项目的配置中将参数 `math` 设置为 `true`
- 要逐页启用 KaTeX,请在内容文件中包含参数 `math: true`
**注意:**使用 [Supported TeX Functions](https://katex.org/docs/supported.html) 的在线参考
{{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }}
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js" integrity="sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
{{ end }}
{{</ math.inline >}}
### 示例
{{< math.inline >}}
<p>
行内数学:\( arphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
</p>
{{</ math.inline >}}
块级数学:
$$
arphi = 1+ rac{1} {1+ rac{1} {1+ rac{1} {1+\cdots} } }
$$
57 changes: 57 additions & 0 deletions exampleSite/content/post/rich-content/index.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
+++
author = "Hugo Authors"
title = "富文本内容"
date = "2019-03-10"
description = "Hugo Shortcodes的简单说明"
tags = [
"shortcodes",
"privacy",
]
asciinema = true
+++

Hugo 附带了几个用于丰富内容的[Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes),以及一个[隐私配置](https: //gohugo.io/about/hugo-and-gdpr/)和一组简单的短代码,可实现各种社交媒体嵌入的静态和非 JS 版本。
<!--more-->
---

## YouTube Privacy Enhanced Shortcode

{{< youtube ms32oqonz04 >}}

<br>

---

## Twitter Simple Shortcode

{{< tweet user="SanDiegoZoo" id="1453110110599868418" >}}

<br>

---

## Vimeo Simple Shortcode

{{< vimeo_simple 48912912 >}}

<br>

---

## BiliBili Simple Shortcode

{{< bilibili BV1kE41147oo >}}

<br>

---

## Asciinema

### Embed Shortcode

{{< asciinema 239367 >}}

### Local Shortcode

{{< asciinema_local "239367.cast" >}}

0 comments on commit 3609ec8

Please sign in to comment.