Skip to content

Commit

Permalink
Merge pull request #123 from MartinLwx/translation_chinese
Browse files Browse the repository at this point in the history
Add Chinese translation in documentation and hugo.toml
  • Loading branch information
khusika authored Jan 20, 2024
2 parents 934cbc9 + 5391583 commit 4e93971
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ toc:
直接安装满足你操作系统 (**Windows**, **Linux**, **macOS**) 的最新版本 [:(fa-regular fa-file-archive fa-fw): Hugo (> 0.110.0)](https://gohugo.io/getting-started/installing/).

{{< admonition note "为什么不支持早期版本的 Hugo?" >}}
Since [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks) were introduced in [Hugo Christmas Edition](https://gohugo.io/news/0.62.0-relnotes/), and some image sources are using webp which was introduced in [0.84.0](https://github.com/gohugoio/hugo/releases/tag/v0.84.0) and also we changed config.toml to hugo.toml, this theme only supports Hugo versions above **0.110.0**.
因为 [Hugo Christmas Edition](https://gohugo.io/news/0.62.0-relnotes/) 版本引入了 [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks), 而且一些图片资源用到了 [0.84.0](https://github.com/gohugoio/hugo/releases/tag/v0.84.0) 版本引入的 webp 格式,并且我们将配置文件改成了 hugo.toml 而不是 config.toml. 所以这一个主题只支持大于 0.110.0 版本的 Hugo.
{{< /admonition >}}

{{< admonition tip "推荐使用 Hugo extended 版本" >}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Hugo 附带了一组预定义的 shortcodes, 它们实现了一些非常常见

{{< version 1.0.0 changed >}}

At the moment, Hugo using deprecated [oEmbed-legacy](https://developers.facebook.com/docs/instagram/oembed-legacy) linked API endpoint. Those deprecated API causes an error when Hugo retrieving the data. The newest API has been included in the [extended shortcode](https://feelit.khusika.dev/theme-documentation-extended-shortcodes/#122-oembed-instagram).
当下 Hugo 使用已被弃用的 [oEmbed-legacy](https://developers.facebook.com/docs/instagram/oembed-legacy) 链接 API 端点. 这些被弃用的 API 会导致 Hugo 在获取数据时发生错误. 最新的 API 已经被包括在了 [extended shortcode](https://feelit.khusika.dev/theme-documentation-extended-shortcodes/#122-oembed-instagram).

## 5 param

Expand All @@ -138,7 +138,8 @@ At the moment, Hugo using deprecated [oEmbed-legacy](https://developers.facebook

{{< version 1.0.1 changed >}}

This method was moved with the newest API in the [extended shortcode documentation](https://feelit.khusika.dev/theme-documentation-extended-shortcodes/#123-oembed-twitter).
随着 [extended shortcode documentation](https://feelit.khusika.dev/theme-documentation-extended-shortcodes/#123-oembed-twitter) 里最新 API 的发布, 该方法已经被移除.


## 8 vimeo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1356,23 +1356,23 @@ console.log('Hello FeelIt!');

{{< version 1.0.1 changed >}}

oEmbed endpoints allow you to get embed HTML and basic metadata for pages, posts, and videos in order to display them in another website or app. The oEmbed endpoints require either an App Access Token or Client Access Token.
oEmbed 端点允许你获得页面、文章和视频的嵌入 HTML 和基本的元数据,这样就可以在其他的网站或者 App 上使用. 要使用 oEmbed 端点需要 App Access Token 或者是 Client Access Token.

### 12.1 oEmbed Facebook
{{< version 1.0.1 >}}

**a. oEmbed Facebook Pages**

Sample input of Facebook Pages
Facebook Pages 为例,输入为
```markdown
{{</* oembed "fb" "page" "https://www.facebook.com/FacebookforDevelopers" */>}}
```

Sample output of Facebook Pages
Facebook Pages 为例,输出为

{{< oembed "fb" "page" "https://www.facebook.com/FacebookforDevelopers" >}}

URL Formats
URL 格式

```html
https://www.facebook.com/{page-name}
Expand All @@ -1381,17 +1381,17 @@ https://www.facebook.com/{page-id}

**b. oEmbed Facebook Posts**

Sample input of Facebook Posts
Facebook Posts 为例,输入为

```markdown
{{</* oembed "fb" "post" "https://www.facebook.com/FacebookforDevelopers/photos/a.441861428552/10151617410093553" */>}}
```

Sample output of Facebook Posts
Facebook Posts 为例,输出为

{{< oembed "fb" "post" "https://www.facebook.com/FacebookforDevelopers/photos/a.441861428552/10151617410093553" >}}

URL Formats
URL 格式

```html
https://www.facebook.com/{page-name}/posts/{post-id}
Expand All @@ -1407,17 +1407,17 @@ https://www.facebook.com/notes/{username}/{note-url}/{note-id}

**c. oEmbed Facebook Videos**

Sample input of Facebook Videos
Facebook Videos 为例,输入为

```markdown
{{</* oembed "fb" "video" "https://www.facebook.com/FacebookforDevelopers/videos/2201055573317594" */>}}
```

Sample output of Facebook Videos
Facebook Videos 为例,输出为

{{< oembed "fb" "video" "https://www.facebook.com/FacebookforDevelopers/videos/2201055573317594" >}}

URL Formats
URL 格式

```html
https://www.facebook.com/{page-name}/videos/{video-id}/
Expand All @@ -1431,37 +1431,37 @@ https://www.facebook.com/video.php?v={video-id}

**a. oEmbed Instagram Post**

Sample input of Instagram Post
Instagram Post 为例,输入为

```markdown
{{</* oembed "ig" "p" "BWNjjyYFxVx" "hidecaption" */>}}
```

Sample output of Instagram Post
Instagram Post 为例,输出为

{{< oembed "ig" "p" "BWNjjyYFxVx" "hidecaption" >}}

**b. oEmbed Instagram TV**

Sample input of Instagram TV
Instagram TV 为例,输入为

```markdown
{{</* oembed "ig" "tv" "BkQUbR8h1sp" "hidecaption" */>}}
```

Sample output of Instagram TV
Instagram TV 为例,输出为

{{< oembed "ig" "tv" "BkQUbR8h1sp" "hidecaption" >}}

### 12.3 oEmbed Twitter
{{< version 1.0.1 >}}

Sample input of 'oembed tweet'
'oembed tweet' 为例,输入为

```markdown
{{</* oembed "tweet" "https://twitter.com/GoHugoIO/status/877500564405444608" */>}}
```

Sample output of 'oembed tweet'
'oembed tweet' 为例,输出为

{{< oembed "tweet" "https://twitter.com/GoHugoIO/status/877500564405444608" >}}
14 changes: 13 additions & 1 deletion exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enableGitInfo = true
# 是否使用 emoji 代码
enableEmoji = true
# UA-PROPERTY_ID or G-MEASUREMENT_ID google analytics code
# UA-PROPERTY_ID 或者是 G-MEASUREMENT_ID 的 google analytics 代码
googleAnalytics = ""

ignoreErrors = ["err-missing-comment-accesstoken", "err-missing-oembed-accesstoken", "error-remote-getjson"]
Expand Down Expand Up @@ -555,13 +556,17 @@ ignoreErrors = ["err-missing-comment-accesstoken", "err-missing-oembed-accesstok
# 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"]
# whether to enable CSS and JS source mapping
# 是否要开启 CSS 和 JS 资源映射
SourceMap = false

# PWA config
# PWA 配置
[params.pwa]
# whether to enable PWA support
# 是否要启用 PWA
enable = true
# service-worker version
# service-worker 版本
version = "1.0.2"

# Header config
Expand Down Expand Up @@ -648,11 +653,14 @@ ignoreErrors = ["err-missing-comment-accesstoken", "err-missing-oembed-accesstok
rss = 10

# oEmbed config for Facebook and Instagram
# oEmbed 配置,用于 Facebook 和 Instagram
[params.oembed]
# Privacy config (https://gohugo.io/about/hugo-and-gdpr/)
# 隐私设置 (https://gohugo.io/about/hugo-and-gdpr/)
privacy = false
[params.oembed.facebook]
# Facebook Aplication Identity and Client Token (<APPID>|<CLIENTTOKEN>)
# Facebook Application Identity and Client Token (<APPID>|<CLIENTTOKEN>)
# Facebook 的 Application Identity 和 Client Token (<APPID>|<CLIENTTOKEN>)
accessToken = ""
[params.oembed.twitter]
enableDNT = false
Expand Down Expand Up @@ -1014,14 +1022,17 @@ ignoreErrors = ["err-missing-comment-accesstoken", "err-missing-oembed-accesstok
[params.analytics]
enable = false
# Fathom Analytics
# Fathom 分析
[params.analytics.fathom]
id = ""
# server url for your tracker if you're self hosting
# 自行托管追踪器时的主机路径
server = ""
# GoatCounter Analytics
# GoatCounter 分析
[params.analytics.goatcounter]
# GoatCounter code
# GoatCounter 代码
code = ""

# Cookie consent config
Expand Down Expand Up @@ -1125,6 +1136,7 @@ ignoreErrors = ["err-missing-comment-accesstoken", "err-missing-oembed-accesstok
respectDoNotTrack = false
useSessionStorage = false
# privacy of the Intagram (replaced by params.oembed.instagram)
# Instagram 相关隐私 (被替换为 params.oembed.instagram)
[privacy.instagram]
# ...
[privacy.twitter]
Expand Down

Large diffs are not rendered by default.

0 comments on commit 4e93971

Please sign in to comment.