feat(widget): 添加 postSlug 配置以支持多语言/多路径评论聚合

- 在配置面板和核心逻辑中新增 postSlug 字段,允许自定义评论标识符
- 更新前端配置文档,说明 postSlug 的用途和默认行为
- 当未配置 postSlug 时,默认仍使用 window.location.pathname
This commit is contained in:
anghunk
2026-02-09 17:23:21 +08:00
parent cf068a6dc1
commit 6d2e1659d0
4 changed files with 36 additions and 16 deletions

View File

@@ -30,6 +30,7 @@
h1 {
margin-bottom: 20px;
color: #333;
font-size: 1.4rem;
}
.config-panel {
@@ -133,6 +134,10 @@
<label>Site ID可选用于隔离不同站点/环境的评论)</label>
<input type="text" id="siteId" placeholder="例如blog、dev、zishu.me" />
</div>
<div class="config-item">
<label>自定义 postSlug可选留空则使用当前路径</label>
<input type="text" id="postSlug" placeholder="例如post-unique-id-001用于多语言/多路径聚合" />
</div>
<div class="config-item">
<label>主题</label>
<select id="theme">