浏览代码

Add release record 010 for the commit link

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude 12 小时之前
父节点
当前提交
5982507d11

+ 36 - 0
pull-releases/010-commit-link/README.md

@@ -0,0 +1,36 @@
+# Link the About page's commit hash to the commit
+
+Branch `feature/commit-link` · version 0.5.3
+
+## What changed
+
+- **Linked hash:** the About page's build hash, e.g. `0.5.3 (d2a387e)`, now links to that commit in Gogs. The link uses the full hash: `https://git.monoaf.com/bajdev/posts/commit/<full hash>`.
+- **New `repoURL` setting:** optional, in `content/site.json`, defaulting to `https://git.monoaf.com/bajdev/posts`. Anyone running a fork of the code can point the link at their own repo.
+- **Dirty builds aren't linked.** A binary built from uncommitted changes matches no commit, so it still shows `(abc1234-dirty)` as plain text. Pipeline builds always come from a clean checkout, so the live site always has the link.
+- **README:** documents `repoURL`.
+- **Version:** 0.5.3.
+
+## Notes
+
+- Since Phase 7, the live site is always built from the tip of `main`, so the link goes to the merge commit that's running.
+- The hash display is unchanged; only the link is new.
+
+## Testing
+
+- All tests pass with the race detector (`go test -race ./...`).
+- New test covering four cases: a clean build links the full hash, `repoURL` in `site.json` overrides the link, a dirty build shows `-dirty` with no link, and no commit at all shows the bare version.
+- Built from a clean local commit and checked the About page HTML: the link went to `/commit/<full hash>` of that build. Gogs commit URLs return 200 for the full hash.
+
+| About page |
+|---|
+| [![About page](about-link.png)](about-link.png) |
+
+## Screenshots
+
+From the branch's build running locally. The home page doesn't change.
+
+| Desktop | Mobile |
+|---|---|
+| [![Desktop](desktop.png)](desktop.png) | [![Mobile](mobile.png)](mobile.png) |
+
+🤖 Generated with [Claude Code](https://claude.com/claude-code)

二进制
pull-releases/010-commit-link/about-link.png


二进制
pull-releases/010-commit-link/desktop.png


二进制
pull-releases/010-commit-link/mobile.png


+ 1 - 0
pull-releases/README.md

@@ -36,3 +36,4 @@ screenshot, or its `README.md` doesn't load.
 | [007](007-pinned-posts/) | Pinned posts |
 | [008](008-tab-size/) | Tabs in code blocks 4 columns wide |
 | [009](009-pager-order/) | Previous post on the left, next on the right |
+| [010](010-commit-link/) | About page commit hash links to the commit |