Skip to content

Commit e083f59

Browse files
committed
add giscus support
1 parent 544fbcc commit e083f59

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ endif
66

77
.PHONY: serve
88
serve:
9-
zine
9+
zine --port 1313
1010

1111
.PHONY: lint
1212
lint:

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ Create corresponding recipe in the language folder, localize it, and submit a [p
3535

3636
# Acknowledgment
3737

38-
The **initial** version of the Zig Cookbook was inspired by several other similar projects. We would like to thank the following projects, thanks for their awesome work.
38+
Zig Cookbook was inspired by several other similar projects. We would like to thank the following projects, thanks for their awesome work.
3939

4040
- [Rust Cookbook](https://github.com/rust-lang-nursery/rust-cookbook)
41-
42-
The **current** version of the Zig Cookbook is based on [zine-ssg](https://zine-ssg.io), thanks for their awesome work.
41+
- [zine-ssg](https://zine-ssg.io), thanks to [Loris Cro](https://github.com/kristoff-it) for creating this awesome static site generator for Zig.
4342

4443
# Star History
4544

46-
## Star History
47-
4845
[![Star History Chart](https://api.star-history.com/svg?repos=zigcc/zig-cookbook&type=Date)](https://www.star-history.com/#zigcc/zig-cookbook&Date)
4946

5047
# License

assets/giscus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function appendGiscusScript() {
2-
const pageDiv = document.querySelector('#content > main');
2+
const pageDiv = document.querySelector('div.content > article');
33

44
if (!pageDiv) {
55
console.error('Could not find div with class "page"');
@@ -32,4 +32,4 @@ function appendGiscusScript() {
3232
pageDiv.appendChild(script);
3333
}
3434

35-
document.addEventListener('DOMContentLoaded', appendGiscusScript);
35+
document.addEventListener('DOMContentLoaded', appendGiscusScript);

layouts/section.shtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<extend template="base.shtml">
22
<head id="head">
33
<script defer src="$site.asset('toc.js').link()"></script>
4+
<script defer src="$site.asset('giscus.js').link()"></script>
45
</head>
56
<body id="body">
67
<div class="mobile-header">
@@ -29,7 +30,14 @@
2930
</div>
3031
</ctx>
3132
<div id="footer">
32-
<div>&copy; 2023 - 2025 <a href="https://github.com/zigcc/zig-cookbook/graphs/contributors">ZigCC and contributors</a></div>
33+
<div>&copy; 2023 - 2025
34+
| <a href="https://github.com/zigcc/zig-cookbook">GitHub</a>
35+
| <a href="http://ziglang.cc">Zig 中文社区</a>
36+
| <a href="http://course.ziglang.cc">Zig 圣经</a>
37+
| <a href="http://ask.ziglang.cc/discord">Discord</a>
38+
| <a href="http://ask.ziglang.cc/telegram">Telegram</a>
39+
| <a href="http://ask.ziglang.cc/weixin">微信群</a>
40+
</div>
3341
<div :text="$i18n.get('languages_menu')"></div>
3442
<div class="langs" :loop="$page.locales()">
3543
<a href="$loop.it.link()">

src/en-US/index.smd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This cookbook is a work in progress, and we welcome contributions from the commu
4444

4545
## Localization
4646

47-
Create corresponding recipe in the language you want to localize, localize it, and submit a pull request.
47+
Create corresponding recipe in the language folder, localize it, and submit a [pull request](https://github.com/zigcc/zig-cookbook/pulls).
4848

4949
# Acknowledgment
5050

0 commit comments

Comments
 (0)