Skip to content

Commit af196d6

Browse files
committed
add contributingUrl
1 parent 4644972 commit af196d6

File tree

9 files changed

+87
-9
lines changed

9 files changed

+87
-9
lines changed

config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ description = 'Zig Chinese Community is dedicated to sharing and spreading the u
1616
name = "博客"
1717
weight = 21
1818
url = "/post"
19+
[[menu.main]]
20+
name = "贡献"
21+
weight = 30
22+
url = "/contributing"
1923
[[menu.main]]
2024
name = "社区"
2125
weight = 40

content/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Zig 中文社区致力于在中文用户中分享和传播 Zig 语言!
1616

1717
无论你是 Zig 专家还是初学者,[我们都欢迎你的加入](/community)
1818

19-
<a class="btn btn-lg btn-primary" href="https://github.com/zigcc">GitHub<i class="fab fa-github ms-2 "></i></a>
19+
<a class="btn btn-lg btn-primary" href="/contributing">贡献<i class="fab fa-github ms-2 "></i></a>
2020
<a class="btn btn-lg btn-primary" href="learn">
2121
学习<i class="fas fa-arrow-alt-circle-right ms-2"></i>
2222
</a>

content/community/_index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
---
2-
title: 博客
2+
title: 社区
3+
params:
4+
contributingUrl: /contributing
35
---
46

57
{{% blocks/section color="white" %}}
68

79
由于 Zig 目前还处于快速迭代,因此最权威的资料无疑是官方的 [Zig Language Reference](https://ziglang.org/documentation/master/),遇到语言的细节问题,基本都可以在这里找到答案。 其次是社区的一些高质量教程,例如:
810

9-
- **[Zig Guide](https://zig.guide/):** 英文资料, [Sobeston](https://github.com/Sobeston) 用户编写
11+
- **[Zig Guide](https://zig.guide/):** 英文资料, [Sobeston](https://github.com/Sobeston) 编写
1012
- **[Zig in 30 minutes](https://gist.github.com/ityonemo/769532c2017ed9143f3571e5ac104e50):**
1113
- **[Zig 日报](https://github.com/zigcc/forum/issues):**
1214
- **[学习 Zig](https://learn.ziglang.cc):** 该系列教程最初由 Karl Seguin 编写,该教程行文流畅,讲述的脉络由浅入深,深入浅出,是入门 Zig 非常不错的选择

content/contributing.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: 如何贡献
3+
type: docs
4+
---
5+
6+
Zig 中文社区是一个开放的组织,我们致力于推广 Zig 在中文群体中的使用,有多种方式可以参与进来:
7+
1. 供稿,分享自己使用 Zig 的心得,方式见下文
8+
2. 改进 zigcc 组织下的开源项目,这是 [open issues](https://github.com/search?q=repo%3Azigcc%2Fzig-cookbook+repo%3Azigcc%2Fzig-course++repo%3Azigcc%2Fasdf-zig++repo%3Azigcc%2Fasdf-zig++state%3Aopen&type=issues&ref=advsearch)
9+
3. 参与不定期的[线上会议](/post/news/)
10+
11+
# 供稿方式
12+
13+
1. Fork 仓库 https://github.com/zigcc/zigcc.github.io
14+
2.`content/post` 内添加自己的文章(md 或 org 格式均可),文件命名为: `${YYYY}-${MM}-${DD}-${SLUG}.md`
15+
3. 文件开始需要包含一些描述信息,例如[本文件](https://github.com/zigcc/zigcc.github.io/tree/main/content/post/2023-09-05-hello-world.md)中的:
16+
17+
```plain
18+
---
19+
title: 欢迎 Zig 爱好者向本网站供稿
20+
author: 刘家财
21+
date: '2023-09-05T16:13:13+0800'
22+
---
23+
```
24+
25+
## 本地预览
26+
27+
在写完文章后,可以使用 [Hugo](https://gohugo.io/) 进行本地预览,只需在项目根目录执行 `hugo server`,这会启动一个 HTTP 服务,默认的访问地址是: http://localhost:1313/
28+
29+
## 发布平台
30+
31+
- [ZigCC 网站](https://ziglang.cc)
32+
- [ZigCC 公众号](https://github.com/zigcc/.github/raw/main/zig_mp.png)

content/learn/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ cascade:
2424
技术文档的翻译首要原则是准确,但在准确的前提下如何保证『信、达、雅』?这是个挑战,在翻译本教程时,在某些情况下会根据上下文进行意译,便于中文读者阅读。
2525

2626
最后,感谢翻译者的无私贡献。❤️️
27+
28+
## 离线阅读
29+
30+
在本仓库的 [release 页面](https://github.com/zigcc/zigcc.github.io/releases)会定期将本教程导出为 PDF 格式,读者可按需下载。
31+
32+
读者也可以使用右侧导航栏中的『[整节打印](_print)』将当前版本教程保存为 PDF 格式。

content/monthly/202408.org

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#+TITLE: 202410
2+
#+DATE: 2024-10-26T00:17:35+0800
3+
#+LASTMOD: 2024-10-26T13:05:32+0800
4+
* 重大事件
5+
* 观点/教程
6+
** [[https://mrcat.au/blog/zig_is_cool/][Zig is everything I want C to be]]
7+
对 Zig 的特色进行了简单扼要的介绍,主要有:
8+
1. UB 行为检测。
9+
- Zig 的指针不能是 null,需要用 optional 类型
10+
- C 里面的 =void*= 等价于 Zig 里面的 =?*anyopaque= 。 =void= 在 C 里面有两个意思,第一是『什么都没有』,第二是『类型不确定』,但 =void= 在 Zig 中只有第一个含义,因此用了 =anyopaque= 来表示类型擦除的指针(type-erased pointers)。
11+
- 数组越界检查
12+
- 整数溢出
13+
2. Bitfield, =packed struct= 可以方便的用来进行协议解析,比如对于 32 位的 RISC-V 的指令,可以这么定义解析:
14+
#+begin_src zig
15+
const IType = packed struct {
16+
opcode: u7,
17+
rd: u5,
18+
funct3: u3,
19+
rs1: u5,
20+
imm: i12, // For sign-extension
21+
};
22+
23+
const encoded_instr: u32 = 0xFFF34293;
24+
const instr: IType = @bitCast(encoded_instr);
25+
#+end_src
26+
3. comptime,Zig 进行元编程的基础,类型是一等成员
27+
4. 与 C 无缝交互, =zig cc= 是交叉编译的首选
28+
29+
* 项目/工具
30+
* [[https://github.com/ziglang/zig/pulls?page=1&q=+is%3Aclosed+is%3Apr+closed%3A2024-10-01..2024-11-01][Zig 语言更新]]

content/post/news/_index.org

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#+TITLE: 社区新闻
22
#+DATE: 2024-08-03T16:43:51+0800
3-
#+LASTMOD: 2024-08-18T12:00:13+0800
3+
#+LASTMOD: 2024-11-03T10:21:19+0800
44
#+TYPE: docs
55

6-
我们会定期举行线上会议来畅聊 Zig,感兴趣的朋友可以通过下面日历查看,或订阅[[https://calendar.yandex.com/export/ics.xml?private_token=71fd8e02d7944f4e7ae44cc8a9b8877da9e9f2f1&tz_id=Asia/Hong_Kong][这个 iCalendar]]。如果感兴趣,可以发邮件到 [email protected] 索要线上会议地址
6+
我们会不定期举行线上会议来畅聊 Zig,感兴趣的朋友可以通过下面日历查看,或订阅[[https://calendar.yandex.com/export/ics.xml?private_token=71fd8e02d7944f4e7ae44cc8a9b8877da9e9f2f1&tz_id=Asia/Hong_Kong][这个 iCalendar]]。
77

88
#+BEGIN_EXPORT html
9-
<iframe src="https://calendar.yandex.com/embed/week?&layer_ids=29400285&tz_id=Asia/Hong_Kong&layer_names=Zig 中文社区" width="800" height="450" frameborder="0" style="border: 1px solid #eee"></iframe>
9+
<iframe src="https://calendar.yandex.com/embed/month?&layer_ids=29400285&tz_id=Asia/Hong_Kong&layer_names=Zig 中文社区" width="800" height="450" frameborder="0" style="border: 1px solid #eee"></iframe>
1010
#+END_EXPORT
11+
如果感兴趣,可以按照下面方式索要线上会议地址:
12+
1. 发邮件到 [email protected]
13+
2. Discord 群聊:https://discord.gg/UraRxD6WXD

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@ module zigcc
22

33
go 1.22.0
44

5-
require (
6-
github.com/google/docsy v0.10.0 // indirect
7-
)
5+
require github.com/google/docsy v0.11.0 // indirect

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2+
github.com/FortAwesome/Font-Awesome v0.0.0-20240716171331-37eff7fa00de/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
23
github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg=
34
github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc=
5+
github.com/google/docsy v0.11.0 h1:QnV40cc28QwS++kP9qINtrIv4hlASruhC/K3FqkHAmM=
6+
github.com/google/docsy v0.11.0/go.mod h1:hGGW0OjNuG5ZbH5JRtALY3yvN8ybbEP/v2iaK4bwOUI=
47
github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

0 commit comments

Comments
 (0)