Skip to content

fix: add umami & ga4 placeholder in index.html of default theme#4928

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
NitroRCr:fix-analytics
May 17, 2026
Merged

fix: add umami & ga4 placeholder in index.html of default theme#4928
seefs001 merged 1 commit into
QuantumNous:mainfrom
NitroRCr:fix-analytics

Conversation

@NitroRCr
Copy link
Copy Markdown
Contributor

@NitroRCr NitroRCr commented May 17, 2026

📝 变更描述 / Description

main.go 中通过替换 <!--umami--><!--Google Analytics--> 为脚本代码来注入相关的分析脚本,但新版界面(default)的 index.html 中没有这两个 placeholder,因此脚本不会注入。

此 PR 添加了这两个 placeholder,确保新版界面在配置 umami, GA4 的情况下能够正常注入相关脚本,closes #4927

🚀 变更类型 / Type of change

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

修复后已实际运行测试 GA4 工作正常
image

Summary by CodeRabbit

  • Chores
    • Added placeholder comments in the application header for analytics services.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2675ba4f-7852-4d7a-b483-a59d508300b3

📥 Commits

Reviewing files that changed from the base of the PR and between f69ceb6 and 50ac079.

📒 Files selected for processing (1)
  • web/default/index.html

Walkthrough

This PR adds placeholder comment markers for umami and Google Analytics within the HTML document head. These markers serve as anchor points for dynamic script injection based on environment variable configuration, addressing the issue where analytics scripts were not being loaded in the new UI.

Changes

Analytics Integration Setup

Layer / File(s) Summary
Analytics placeholder markers
web/default/index.html
Comment placeholders for umami and Google Analytics added to the <head> section to enable script injection during rendering.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

📊 Tiny comments, modest and bright,
Umami and Analytics in sight,
Two placeholders wait so still,
For scripts to inject at will,
Analytics dance takes flight! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding umami and GA4 placeholders to index.html.
Linked Issues check ✅ Passed The PR directly addresses issue #4927 by adding the required analytics placeholders to enable script injection.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the analytics injection issue; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seefs001 seefs001 merged commit 5dd0d3b into QuantumNous:main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

新版界面不会注入 umami / GA4 脚本

2 participants