Skip to content

Commit 3dbb247

Browse files
committed
fix: upgrade OINK to v1.3.0 and align site integration
1 parent 9ab891f commit 3dbb247

76 files changed

Lines changed: 446 additions & 436 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/pages.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
contents: read
2323
pages: read
2424
env:
25-
HUGO_VERSION: 0.164.0
25+
HUGO_VERSION: 0.166.0
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v7

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ d: debug
1313
s: serve
1414

1515
dev:
16-
HUGO_MODULE_REPLACEMENTS='github.com/pgsty/oink -> $(abspath $(THEME_DIR))' \
16+
GOWORK=off HUGO_MODULE_WORKSPACE=off HUGO_MODULE_REPLACEMENTS='github.com/pgsty/oink -> $(abspath $(THEME_DIR))' \
1717
$(HUGO) server --renderToMemory --bind "$(BIND)" $(if $(strip $(PORT)),--port "$(PORT)")
1818

1919
debug: dev

‎README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ OINK or Docsy templates into this repository.
3535

3636
## Theme dependency
3737

38-
OINK 1.2.0 is imported as a Hugo Module in `hugo.yaml` and pinned in `go.mod`. The homepage is
38+
OINK 1.3.0 is imported as a Hugo Module in `hugo.yaml` and pinned in `go.mod`. The homepage is
3939
composed by OINK from bilingual data. Docs and blog pages also render through the theme;
4040
the site keeps only product-specific data and templates.
4141

@@ -62,7 +62,7 @@ make d
6262

6363
## Local development
6464

65-
Install Hugo Extended 0.160.1 or newer, Go 1.27.0 or newer, and Git, then run the local server:
65+
Install Hugo Extended 0.166.0 or newer, Go 1.27.0 or newer, and Git, then run the local server:
6666

6767
```bash
6868
make s
@@ -123,3 +123,7 @@ See [LICENSE](LICENSE) for the complete legal code. Third-party software and ass
123123
their respective licenses; OINK itself is licensed under Apache License 2.0.
124124

125125
[cc-by-4]: https://creativecommons.org/licenses/by/4.0/
126+
127+
### Custom anchors in Print
128+
129+
Page-local HTML anchors declare `data-td-print-local`. OINK 1.3 preserves their ordinary HTML and single-page Print IDs, and namespaces them when chapters are aggregated for Print. Keep this marker on legacy heading aliases and package-profile headings so chapters do not share IDs. Use `make dev` with the sibling `../oink` checkout for local theme development; production builds use the published module pin.

‎bin/check_internal_links.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class DocumentParser(html.parser.HTMLParser):
2626
def __init__(self) -> None:
2727
super().__init__(convert_charrefs=True)
2828
self.ids: set[str] = set()
29+
self.duplicate_ids: set[str] = set()
2930
self.links: list[str] = []
3031
self.redirect_target: str | None = None
3132

@@ -39,6 +40,8 @@ def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None
3940
if value is None:
4041
continue
4142
if key == "id" or (tag == "a" and key == "name"):
43+
if key == "id" and value in self.ids:
44+
self.duplicate_ids.add(value)
4245
self.ids.add(value)
4346
if key in LINK_ATTRIBUTES:
4447
self.links.append(value.strip())
@@ -105,8 +108,11 @@ def main() -> int:
105108

106109
failures: dict[str, list[str]] = collections.defaultdict(list)
107110
checked = 0
111+
resolved_paths: dict[str, pathlib.Path | None] = {}
108112
for source_path, document in documents.items():
109113
source_route = route_for_file(public, source_path)
114+
for identifier in sorted(document.duplicate_ids):
115+
failures[f"duplicate id {identifier}"].append(source_route)
110116
for raw_url in document.links:
111117
target = resolve_internal_url(source_route, raw_url)
112118
if target is None:

‎content/blog/design/_index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Start with these current design explanations:
2929
- [Publication and recovery](/blog/design/publication/): upload order, checkpoints, and cleanup.
3030
- [Design principles](/blog/design/principles/): state ownership and coordination.
3131

32-
<span id="authority-and-evidence"></span>
32+
<span id="authority-and-evidence" data-td-print-local></span>
3333

3434
The historical series follows the v0.1 program, its design decisions and tests, the v0.2
3535
reset, and later releases. It links to dated source snapshots. Use [SOW Docs](/docs/) for

‎content/blog/design/_index.zh.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cascade:
2828
- [发布与恢复](/zh/blog/design/publication/):上传顺序、检查点与清理。
2929
- [设计原则](/zh/blog/design/principles/):状态归属与写入协调。
3030

31-
<span id="权威与证据"></span>
31+
<span id="权威与证据" data-td-print-local></span>
3232

3333
历史系列介绍 v0.1 产品计划、设计决策与测试,以及 v0.2 重构和后续版本,并链接到对应源码快照。
3434
当前命令见 [SOW 文档](/zh/docs/),各版本变化见[发布说明](/zh/blog/release/)。

‎content/blog/design/coordinated-publication.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ icon: fa-solid fa-cloud-arrow-up
1515
draft: false
1616
---
1717

18-
<span id="decision"></span>
18+
<span id="decision" data-td-print-local></span>
1919

2020
SOW 0.4.0 kept the native `filesystem` and `r2` publication backends. An earlier proposal
2121
used rclone and added remote audit and preview commands. The native design was selected
2222
because SOW needs to track each conditional write and its result.
2323

2424
Current command syntax is in [`sow publish`](/docs/command/publish/).
2525

26-
<span id="why-the-executor-proposal-was-not-adopted"></span>
27-
<span id="what-040-shipped"></span>
26+
<span id="why-the-executor-proposal-was-not-adopted" data-td-print-local></span>
27+
<span id="what-040-shipped" data-td-print-local></span>
2828

2929
## Why keep native backends
3030

@@ -42,24 +42,24 @@ The 0.4 work instead improved the existing backend:
4242

4343
This retained the existing publication state and avoided a transport migration.
4444

45-
<span id="native-incremental-publication"></span>
46-
<span id="hardened-public-visibility"></span>
47-
<span id="operator-workflow"></span>
45+
<span id="native-incremental-publication" data-td-print-local></span>
46+
<span id="hardened-public-visibility" data-td-print-local></span>
47+
<span id="operator-workflow" data-td-print-local></span>
4848

4949
## Publication workflow
5050

5151
The native backend uploads packages and immutable metadata before updating the repository indexes.
5252
It then checks the public files and records a checkpoint for the target.
5353
The next publication compares the current build with that checkpoint.
5454

55-
<span id="operator-confirmed-rebind"></span>
55+
<span id="operator-confirmed-rebind" data-td-print-local></span>
5656

5757
## Change target settings
5858

5959
A binding revision records changes to the target name, public URL, or cache lifetime.
6060
The target keeps its publication history. A different storage location requires a new target.
6161

62-
<span id="recovery-decision"></span>
62+
<span id="recovery-decision" data-td-print-local></span>
6363

6464
## Resume an interrupted publication
6565

@@ -68,14 +68,14 @@ Before the commit decision, it can abandon the attempt after checking that the i
6868
After that decision, recovery completes the saved plan.
6969
This gives each target one history for upload, verification, and recovery.
7070

71-
<span id="explicit-boundaries"></span>
71+
<span id="explicit-boundaries" data-td-print-local></span>
7272

7373
## Configure serving separately
7474

7575
The operator configures HTTP access, caching, and client trust.
7676
SOW verifies publication through the configured public endpoint.
7777

78-
<span id="references"></span>
78+
<span id="references" data-td-print-local></span>
7979

8080
See [Publication and recovery](/blog/design/publication/) for the complete sequence.
8181
Use [`sow publish`](/docs/command/publish/) for configuration and commands.

‎content/blog/design/coordinated-publication.zh.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ icon: fa-solid fa-cloud-arrow-up
1515
draft: false
1616
---
1717

18-
<span id="最终决策"></span>
18+
<span id="最终决策" data-td-print-local></span>
1919

2020
SOW 0.4.0 保留了原生 `filesystem` 与 `r2` 发布后端。早期提案曾计划使用 rclone,并增加远端审计和预览命令。
2121
最终选择原生后端,是因为 SOW 需要逐项记录条件写入及其结果。
2222

2323
当前命令语法见 [`sow publish`](/zh/docs/command/publish/)。
2424

25-
<span id="为什么没有采用-executor-提案"></span>
26-
<span id="040-实际交付"></span>
25+
<span id="为什么没有采用-executor-提案" data-td-print-local></span>
26+
<span id="040-实际交付" data-td-print-local></span>
2727

2828
## 为什么保留原生后端
2929

@@ -39,37 +39,37 @@ SOW 记录操作结果,用于中断后继续发布。
3939

4040
这保留了已有发布状态,也省去了传输工具的迁移。
4141

42-
<span id="原生增量发布"></span>
43-
<span id="强化公共可见性"></span>
44-
<span id="操作者流程"></span>
42+
<span id="原生增量发布" data-td-print-local></span>
43+
<span id="强化公共可见性" data-td-print-local></span>
44+
<span id="操作者流程" data-td-print-local></span>
4545

4646
## 发布流程
4747

4848
原生后端先上传软件包与不可变元数据,再更新仓库索引。
4949
随后检查公开文件,并为目标记录发布检查点。下次发布以该检查点为基准,计算需要更新的文件。
5050

51-
<span id="操作者确认的-rebind"></span>
51+
<span id="操作者确认的-rebind" data-td-print-local></span>
5252

5353
## 修改目标设置
5454

5555
目标名称、公共 URL 或缓存时间的变化记录在绑定修订中,原发布历史继续保留。
5656
使用不同存储位置时,需要配置新目标。
5757

58-
<span id="恢复决策"></span>
58+
<span id="恢复决策" data-td-print-local></span>
5959

6060
## 继续中断的发布
6161

6262
SOW 为每次发布保存计划与进度。作出提交决定前,确认索引未变化后即可放弃该次发布。
6363
作出提交决定后,恢复流程完成已保存的计划。
6464
上传、校验和恢复因此可以使用同一份发布历史。
6565

66-
<span id="明确边界"></span>
66+
<span id="明确边界" data-td-print-local></span>
6767

6868
## 单独配置访问服务
6969

7070
运维人员配置 HTTP 访问、缓存与客户端信任。SOW 通过配置的公共端点检查发布结果。
7171

72-
<span id="参考资料"></span>
72+
<span id="参考资料" data-td-print-local></span>
7373

7474
完整执行顺序见[发布与恢复](/zh/blog/design/publication/),配置与命令见
7575
[`sow publish`](/zh/docs/command/publish/)。

‎content/blog/design/evolution.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ introduced the package-facts cache, and made Plain generation a rebuildable one-
101101
operation. It also expanded Membership in batches and grouped payload commits to reduce
102102
filesystem work.
103103

104-
<span id="v04-harden-evidence-rather-than-add-another-model"></span>
104+
<span id="v04-harden-evidence-rather-than-add-another-model" data-td-print-local></span>
105105

106106
## v0.4: strengthen verification and recovery
107107

@@ -139,7 +139,7 @@ Several v0.1 rules continue in the smaller model:
139139
- Record compatibility results with the source version, client, provider, and environment
140140
that produced them.
141141

142-
<span id="documentation-authority"></span>
142+
<span id="documentation-authority" data-td-print-local></span>
143143

144144
The current rationale is in [Design Principles](/blog/design/principles/),
145145
[System Model](/blog/design/model/), [Single-Payload Repository](/blog/design/single-payload/),

‎content/blog/design/evolution.zh.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ v0.2.0 也明确区分了本地与远端状态:
8686
v0.3 保持 v0.2.0 公共布局不变。它删除了 V1 运行时与迁移测试工具,引入包属性缓存,
8787
并将 Plain 生成简化为可重建的单遍操作。成员关系改为批量展开,包体改为分组提交,减少文件系统操作。
8888

89-
<span id="v04强化证据不再增加一套模型"></span>
89+
<span id="v04强化证据不再增加一套模型" data-td-print-local></span>
9090

9191
## v0.4:强化校验与恢复
9292

@@ -118,7 +118,7 @@ v0.1 的部分规则继续用于更小的模型:
118118
- 删除前检查引用关系与精确身份;远端删除还要检查缓存宽限期与存储服务能力。
119119
- 兼容性结果记录产生它的源码版本、客户端、存储服务和环境。
120120

121-
<span id="文档权威边界"></span>
121+
<span id="文档权威边界" data-td-print-local></span>
122122

123123
当前设计理由见[设计原则](/zh/blog/design/principles/)、[系统模型](/zh/blog/design/model/)、
124124
[单包体仓库](/zh/blog/design/single-payload/)和[发布与恢复](/zh/blog/design/publication/)。

0 commit comments

Comments
 (0)