Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,29 @@ blockquote p {
margin: 0;
}

/* -- AI Notice -- */

.ai-notice {
margin: 1.5rem 0;
padding: 0.875rem 1.25rem;
background: #fffbeb;
border: 1px solid #f59e0b;
border-left: 4px solid #f59e0b;
border-radius: 6px;
color: #92400e;
font-size: 0.95rem;
line-height: 1.6;
}
Comment on lines +835 to +845
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new .ai-notice styling introduces a separate yellow/orange palette via hard-coded hex values, even though the stylesheet already defines shared design tokens (e.g. --brand-accent, --bg-*, --text-*) for light/dark theming. To keep the theme consistent and avoid duplicating color decisions, consider reusing existing tokens (or adding dedicated --ai-notice-* tokens in :root + dark override) instead of embedding raw hex colors in the component rules.

Copilot uses AI. Check for mistakes.

@media (prefers-color-scheme: dark) {
.ai-notice {
background: #1c1a0e;
border-color: #b45309;
border-left-color: #f59e0b;
color: #fcd34d;
}
}

/* -- Code Blocks -- */

.code-block-container {
Expand Down
19 changes: 19 additions & 0 deletions content/contributing.smd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Zig 中文社区是一个开放的组织,我们致力于推广 Zig 在中文
.custom = {
.math = true, // 引入 Katex 数学公式支持
.mermaid = true, // 引入 mermaid 图表渲染支持
.ai_generated = true, // 标注文章使用了 AI 辅助创作
},
---
```
Expand All @@ -42,6 +43,24 @@ Zig 中文社区是一个开放的组织,我们致力于推广 Zig 在中文
- [Getting Started  |  WebP  |  Google for Developers](https://developers.google.com/speed/webp/docs/using)


## [AI 辅助创作说明]($heading.id('ai-generated'))

如果文章内容使用了 AI(如 ChatGPT、Claude、Copilot 等)辅助生成,请在 frontmatter 中添加 `ai_generated = true`:

```ziggy
.custom = {
.ai_generated = true,
},
```

设置后,文章末尾会自动显示一个提示横幅,提醒读者该内容包含 AI 辅助生成的内容,需结合自身判断阅读。

**注意事项:**

- AI 生成的内容可能存在错误或不准确之处,请在发布前仔细校对
- 作者对文章内容的准确性负责,AI 仅作为辅助工具
- 鼓励在文章中说明 AI 的具体使用方式(如"使用 AI 辅助润色"、"使用 AI 生成初稿后人工校对"等)

## [本地预览]($heading.id('local-preview'))

1. 安装 `zine`,方法见 [Quick Start](https://zine-ssg.io/quickstart/),
Expand Down
3 changes: 3 additions & 0 deletions layouts/post.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
<div :html="$page.toc()"></div>
</div>
<div :html="$page.content()"></div>
<div class="ai-notice" :if="$page.custom.getOr('ai_generated', false)">
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This notice banner will be included in the Pagefind indexed body (it sits inside data-pagefind-body and does not have data-pagefind-ignore), which can pollute search excerpts with the same boilerplate warning on every AI-marked post. Consider adding data-pagefind-ignore to the .ai-notice container (similar to #prev-next, #meta, and TOC blocks) so search indexing focuses on the article content.

Suggested change
<div class="ai-notice" :if="$page.custom.getOr('ai_generated', false)">
<div class="ai-notice" :if="$page.custom.getOr('ai_generated', false)" data-pagefind-ignore>

Copilot uses AI. Check for mistakes.
⚠️ 本文包含 AI 辅助生成的内容,请结合自身判断阅读,作者对内容准确性负责。
</div>
<div id="prev-next" data-pagefind-ignore>
<div :if="$page.prevPage?()">
<a href="$if.link()">
Expand Down
Loading