Skip to content

Commit 1c8f6de

Browse files
committed
chore
1 parent 34a5ef8 commit 1c8f6de

File tree

6 files changed

+41
-6
lines changed

6 files changed

+41
-6
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# https://github.com/github-linguist/linguist/blob/master/docs/overrides.md#documentation
2+
examples/* -linguist-documentation

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy the website to Github Pages
1+
name: Github Pages
22

33
on:
44
push:
@@ -18,7 +18,7 @@ defaults:
1818

1919
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
2020
concurrency:
21-
group: "pages"
21+
group: ${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: true
2323

2424
jobs:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ zig-cache/
44
.zig-cache/
55
.DS_Store
66
.tool-versions
7+
.vscode

.vscode/settings.json

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

assets/giscus.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
function appendGiscusScript() {
2+
const pageDiv = document.querySelector('#content > main');
3+
4+
if (!pageDiv) {
5+
console.error('Could not find div with class "page"');
6+
return;
7+
}
8+
// 创建评论容器
9+
const commentsDiv = document.createElement('div');
10+
commentsDiv.className = 'giscus';
11+
pageDiv.appendChild(commentsDiv);
12+
13+
// 创建 script 元素
14+
const script = document.createElement('script');
15+
// 设置脚本属性
16+
script.src = "https://giscus.app/client.js";
17+
script.setAttribute("data-repo", "zigcc/zig-cookbook");
18+
script.setAttribute("data-repo-id", "R_kgDOK34kdA");
19+
script.setAttribute("data-category", "General");
20+
script.setAttribute("data-category-id", "DIC_kwDOK34kdM4Clt_g");
21+
script.setAttribute("data-mapping", "pathname");
22+
script.setAttribute("data-strict", "1");
23+
script.setAttribute("data-reactions-enabled", "1");
24+
script.setAttribute("data-emit-metadata", "0");
25+
script.setAttribute("data-input-position", "bottom");
26+
script.setAttribute("data-theme", "preferred_color_scheme");
27+
script.setAttribute("data-lang", "en");
28+
script.setAttribute("crossorigin", "anonymous");
29+
script.async = true;
30+
31+
// 将脚本追加到 body 末尾
32+
pageDiv.appendChild(script);
33+
}
34+
35+
document.addEventListener('DOMContentLoaded', appendGiscusScript);

zine.ziggy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Site {
22
.title = "Zig cookbook",
3-
.host_url = "https://example.com",
3+
.host_url = "https://cookbook.ziglang.cc/",
44
.content_dir_path = "src",
55
.layouts_dir_path = "layouts",
66
.assets_dir_path = "assets",

0 commit comments

Comments
 (0)