Skip to content

Commit 0359215

Browse files
committed
refactor: change theme to docsy
1 parent b3864d6 commit 0359215

23 files changed

+243
-105
lines changed

.github/workflows/gh-pages.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
submodules: recursive
3131
- uses: peaceiris/actions-hugo@v2
3232
with:
33-
hugo-version: "0.111.3"
33+
hugo-version: "latest"
3434
extended: true
3535
- name: Setup Pages
3636
id: pages
@@ -41,6 +41,8 @@ jobs:
4141
HUGO_ENVIRONMENT: production
4242
HUGO_ENV: production
4343
run: |
44+
npm i -D postcss postcss-cli autoprefixer
45+
hugo mod get
4446
hugo \
4547
--minify \
4648
--baseURL "${{ steps.pages.outputs.base_url }}/"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.lock
22
.DS_Store
3-
public
3+
/public
4+
/resources
45

56
# zig
67
zig-cache/

README.org

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,22 @@
44
- [[https://ziglang.cc]]
55
- 如果没有特殊声明,本网站内容均采用 [[https://creativecommons.org/licenses/by-nc-nd/4.0/][CC BY-NC-ND 4.0]] 协议
66

7-
* 社区供稿
8-
参见:[[https://ziglang.cc/post/2023/09/05/hello-world/]]
7+
#+BEGIN_EXPORT html
8+
<center>
9+
<p>欢迎来到 Zig 语言中文社区!(Zig Chinese Community,简称:ZigCC)</p>
10+
<a href="https://discord.gg/UraRxD6WXD">
11+
<img src="https://img.shields.io/discord/1155469703846834187?label=Chat at Discord" />
12+
</a>
13+
<a href="/index.xml">
14+
<img src="https://img.shields.io/badge/rss-F88900.svg?style=flat&logo=RSS&logoColor=white&label=网站" />
15+
</a>
16+
<a href="https://ask.ziglang.cc/atom.xml">
17+
<img src="https://img.shields.io/badge/rss-F88900.svg?style=flat&logo=RSS&logoColor=white&label=论坛" />
18+
</a>
19+
</center>
20+
#+END_EXPORT
21+
22+
23+
#+begin_quote
24+
Zig Chinese Community is dedicated to sharing and spreading the use of Zig language among Chinese users.
25+
#+end_quote

config.toml

Lines changed: 67 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,102 @@ baseURL = 'https://ziglang.cc'
22
languageCode = 'en'
33
defaultContentLanguage = 'zh-cn'
44
title = 'Zig 语言中文社区'
5+
description = 'Zig 语言中文社区'
56

6-
[[menu.main]]
7-
name = "主页"
8-
weight = 10
9-
url = "/"
107
[[menu.main]]
118
name = "学习"
129
weight = 11
1310
url = "/learn"
14-
[[menu.main]]
15-
name = "日报"
16-
weight = 15
17-
url = "https://github.com/zigcc/forum/issues"
1811
[[menu.main]]
1912
name = "月刊"
2013
weight = 20
2114
url = "/monthly"
2215
[[menu.main]]
23-
name = "文章"
16+
name = "博客"
2417
weight = 21
2518
url = "/post"
2619
[[menu.main]]
27-
name = "新闻"
28-
weight = 22
29-
url = "/news"
30-
[[menu.main]]
31-
name = "论坛"
32-
weight = 30
33-
url = "https://ask.ziglang.cc"
34-
# [[menu.main]]
35-
# name = "关于"
36-
# weight = 4
37-
# url = "/about"
38-
# [[menu.main]]
39-
# name = "RSS"
40-
# weight = 50
41-
# url = "/index.xml"
20+
name = "社区"
21+
weight = 40
22+
url = "/community"
4223

4324
[params]
44-
description = ""
25+
github_repo = "https://github.com/zigcc/zigcc.github.io"
26+
offlineSearch = true
4527
dateFormat = "Jan 2, 2006"
46-
gitRepo = "https://github.com/zigcc/zigcc.github.io"
4728
twitterCardEnabled = true
4829
[params.giscus]
4930
repo = "zigcc/zigcc.github.io"
5031
repoId = "R_kgDOHr7nSg"
5132
category = "Announcements"
5233
categoryId = "DIC_kwDOHr7nSs4CQUsK"
5334

35+
[params.ui]
36+
navbar_logo = false
37+
showLightDarkModeMenu = true
38+
39+
[params.copyright]
40+
authors = """
41+
| [BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/)
42+
| <a rel="me" href="https://mastodon.social/@liujiacai">Mastodon</a>
43+
| [RSS](/index.xml)
44+
"""
45+
from_year = 2022
46+
[params.links]
47+
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
48+
[[params.links.user]]
49+
name = "GitHub Discussion"
50+
url = "https://github.com/orgs/zigcc/discussions"
51+
icon = "fab fa-github"
52+
[[params.links.user]]
53+
name = "Discord"
54+
url = "https://discord.gg/UraRxD6WXD"
55+
icon = "fab fa-discord"
56+
[[params.links.user]]
57+
name = "Telegram"
58+
url = "https://t.me/ZigChinese"
59+
icon = "fab fa-telegram"
60+
[[params.links.user]]
61+
name = "微信群"
62+
url = "https://github.com/orgs/zigcc/discussions/134"
63+
icon = "fab fa-weixin"
64+
[[params.links.user]]
65+
name = "微信公众号"
66+
url = "https://github.com/zigcc/.github/blob/main/zig_mp.png"
67+
icon = "fab fa-weixin"
68+
[[params.links.user]]
69+
name = "邮件"
70+
url = "mailto:hello@ziglang.cc"
71+
icon = "fa fa-envelope"
72+
desc = "有任何疑问、建议,欢迎通过邮件与我们交流"
73+
74+
[[params.links.developer]]
75+
name = "文章供稿"
76+
url = "/post/2023/09/05/hello-world/"
77+
icon = "fab fa-blogger"
78+
desc = "分享 Zig 使用经验"
79+
[[params.links.developer]]
80+
name = "Zig 圣经"
81+
url = "https://course.ziglang.cc/"
82+
icon = "fa fa-book"
83+
desc = "完善、改进圣经内容"
84+
[[params.links.developer]]
85+
name = "线上会议"
86+
url = "/post/news"
87+
icon = "fa-brands fa-meetup"
88+
desc = "我们会定期举行线上会议,畅聊 Zig 中的一切"
89+
5490
[module]
91+
proxy = "https://goproxy.cn,direct"
5592
[[module.imports]]
56-
path = "github.com/jiacai2050/hugo-xmin"
93+
path = "github.com/google/docsy"
5794

5895
[frontmatter]
5996
date = [":filename", ":default", ":fileModTime"]
6097
lastmod = ['lastmod', ':git', ':fileModTime', ':default']
6198

6299
[permalinks]
63100
post = "/post/:year/:month/:day/:slug/"
64-
news = "/news/:year/:month/:day/:slug/"
65101

66102
[markup]
67103
[markup.tableOfContents]
@@ -70,7 +106,9 @@ title = 'Zig 语言中文社区'
70106
[markup.goldmark]
71107
[markup.goldmark.renderer]
72108
unsafe = true
109+
[markup.goldmark.parser.attribute]
110+
block = true
73111
# https://gohugo.io/getting-started/configuration-markup/#highlight
74112
[markup.highlight]
75113
style = "pygments"
76-
linenos = true
114+
linenos = true

content/_index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Zig 语言中文社区
3+
description: 欢迎来到 Zig 语言中文社区!(Zig Chinese Community,简称:ZigCC)
4+
---
5+
6+
{{% blocks/cover height="full" %}}
7+
8+
<img height="300px" src="https://ziglang.cc/logo/zigcc-logo-2.svg"/>
9+
10+
{{% param description %}}
11+
12+
> Zig Chinese Community is dedicated to sharing and spreading the use of Zig language among Chinese users.
13+
14+
<a class="btn btn-lg btn-primary" href="https://github.com/zigcc">GitHub<i class="fab fa-github ms-2 "></i></a>
15+
<a class="btn btn-lg btn-primary" href="learn">
16+
学习<i class="fas fa-arrow-alt-circle-right ms-2"></i>
17+
</a>
18+
19+
20+
{{% blocks/link-down color="info" %}}
21+
{{% /blocks/cover %}}
22+
23+
{{% blocks/lead color="primary" %}}
24+
25+
我们是一群对 Zig 编程语言充满热情的开发者、学习者和爱好者。我们致力于:
26+
1. 分享 Zig 相关的知识和经验
27+
2. 翻译 Zig 官方文档和重要资源
28+
3. 组织线上线下的学习活动和讨论
29+
4. 推广 Zig 语言在中文开发者中的应用
30+
31+
无论你是 Zig 专家还是初学者,[我们都欢迎你的加入](/community)
32+
{{% /blocks/lead %}}

content/_index.org

Lines changed: 0 additions & 48 deletions
This file was deleted.

content/learn.org renamed to content/about/_index.org

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#+TITLE: 学习 Zig
22
#+DATE: 2024-08-04T08:51:07+0800
3-
#+LASTMOD: 2024-08-04T08:55:33+0800
3+
#+LASTMOD: 2024-08-18T11:48:26+0800
4+
{{% blocks/cover title="学习 Zig" image_anchor="bottom" height="auto" %}}
5+
6+
7+
{{% /blocks/cover %}}
8+
9+
{{% blocks/section %}}
410

511
* 资料
612
由于 Zig 目前还处于快速迭代,因此最权威的资料无疑是官方的 [[https://ziglang.org/documentation/master/][Zig Language Reference]],遇到语言的细节问题,基本都可以在这里找到答案。
@@ -29,3 +35,12 @@ asdf install zig latest
2935
asdf global zig latest
3036
zig version
3137
#+end_src
38+
39+
{{% /blocks/section %}}
40+
41+
{{% blocks/section %}}
42+
43+
# This is another section
44+
{.text-center}
45+
46+
{{% /blocks/section %}}

content/community/_index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: 博客
3+
---
4+
5+
{{% blocks/section %}}
6+
让我们一起探索 Zig 的魅力,推动 Zig 在中文开发者社区的发展!
7+
{.text-center}
8+
9+
{{% /blocks/section %}}
10+
11+
{{% blocks/section color="white" %}}
12+
13+
# 网站更新日志
14+
15+
- **2024-08-18:** 切换主题 [docsy](https://github.com/google/docsy)
16+
- **2024-07-14:** 启用 Zig 社区微信 2 群
17+
- **2024-03-29:** 使用自定义域名 ziglang.cc
18+
- **2022-12-10:** 切换主题 [cupper-hugo](https://github.com/zwbetz-gh/cupper-hugo-theme) &#x2013;> [hugo-xmin](https://github.com/yihui/hugo-xmin)
19+
- **2022-07-20:** 首次上线
20+
{{% /blocks/section %}}

content/learn.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: "学习 Zig"
3+
---
4+
5+
{{% blocks/cover title="如何学习 Zig ?" image_anchor="bottom" height="auto" %}}
6+
7+
{{% /blocks/cover %}}
8+
9+
{{% blocks/section color="white" %}}
10+
11+
由于 Zig 目前还处于快速迭代,因此最权威的资料无疑是官方的 [Zig Language Reference](https://ziglang.org/documentation/master/),遇到语言的细节问题,基本都可以在这里找到答案。 其次是社区的一些高质量教程,例如:
12+
13+
- **[Zig Guide](https://zig.guide/):** 英文资料, [Sobeston](https://github.com/Sobeston) 用户编写
14+
- **[Zig in 30 minutes](https://gist.github.com/ityonemo/769532c2017ed9143f3571e5ac104e50):**
15+
- **[Zig 日报](https://github.com/zigcc/forum/issues):**
16+
- **[学习 Zig](https://learn.ziglang.cc):** 该系列教程最初由 Karl Seguin 编写,该教程行文流畅,讲述的脉络由浅入深,深入浅出,是入门 Zig 非常不错的选择
17+
- **[Zig 语言圣经](https://course.ziglang.cc):** 一份内容全面、深入浅出介绍 Zig 的教程
18+
- **[ziglings/exercises](https://codeberg.org/ziglings/exercises/):** Learn the Zig programming language by fixing tiny broken programs.
19+
- **[Zig Cookbook](https://cookbook.ziglang.cc/):** A collection of simple Zig programs that demonstrate good practices to accomplish common programming tasks
20+
- **[Awesome Zig](https://github.com/zigcc/awesome-zig):** A collection of some awesome public Zig programming language projects.
21+
22+
# 版本管理
23+
24+
推荐使用版本管理工具 [asdf](/post/2023/10/14/zig-version-manager/) 来安装 Zig,具体步骤:
25+
26+
```bash
27+
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
28+
cat <<'EOF' >> $HOME/.bashrc
29+
source "$HOME/.asdf/asdf.sh"
30+
source "$HOME/.asdf/completions/asdf.bash"
31+
EOF
32+
33+
asdf plugin-add zig https://github.com/zigcc/asdf-zig.git
34+
35+
# 安装最新版
36+
asdf install zig latest
37+
asdf global zig latest
38+
zig version
39+
```
40+
41+
42+
{{% /blocks/section %}}

content/monthly/_index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: 月刊
3+
type: blog
4+
cascade:
5+
- type: blog
6+
---
7+
8+
社区内的最新进展,信息来源:[Zig NEWS](https://zig.news/top/month)[Zig monthly](https://zigmonthly.org/)[Lobsters](https://lobste.rs/t/zig)[Reddit](https://www.reddit.com/r/Zig/)[Zig weekly newsletter](https://discu.eu/weekly/zig/)[Ziggit](https://ziggit.dev/)[用户推荐](https://github.com/orgs/zigcc/discussions/new?category=%E4%BD%9C%E5%93%81%E5%88%86%E4%BA%AB)

0 commit comments

Comments
 (0)