Add versioned URL aliases and legacy redirects · w3c/css-houdini-drafts@acae9ee
sideshowbark
·
2026-03-04
·
via Recent Commits to css-houdini-drafts:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -169,6 +169,28 @@ def escape_html(text):
|
169 | 169 | if shortname != currentWorkDir: |
170 | 170 | create_symlink(shortname, currentWorkDir) |
171 | 171 | |
| 172 | +# Create versioned aliases (e.g., font-metrics-api-1 → font-metrics-api) |
| 173 | +# for specs whose folder names don’t include the level suffix. |
| 174 | +for shortname, specgroup in specgroups.items(): |
| 175 | +for spec in specgroup: |
| 176 | +if spec["level"]: |
| 177 | +versioned_name = f"{spec['shortname']}-{spec['level']}" |
| 178 | +if versioned_name != spec["dir"]: |
| 179 | +create_symlink(versioned_name, spec["dir"]) |
| 180 | + |
| 181 | +# Legacy path redirects for old URLs that used different names. |
| 182 | +LEGACY_REDIRECTS = { |
| 183 | +"css-animationworklet-1": "css-animation-worklet-1", |
| 184 | +"css-animationworklet": "css-animation-worklet-1", |
| 185 | +} |
| 186 | + |
| 187 | +for old_path, new_path in LEGACY_REDIRECTS.items(): |
| 188 | +if os.path.exists(new_path) and not os.path.exists(old_path): |
| 189 | +try: |
| 190 | +os.symlink(new_path, old_path) |
| 191 | +except OSError: |
| 192 | +pass |
| 193 | + |
172 | 194 | with open('./timestamps.json', 'w') as f: |
173 | 195 | json.dump(timestamps, f, indent=2, sort_keys=True) |
174 | 196 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。