Skip to content

Commit c92fa7a

Browse files
committed
fix(postprocess): handle docs.internetcomputer.org/developer-tools/#mo-doc after upstream §10 lands
1 parent 3bf44de commit c92fa7a

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

.docs-plan/motoko-repo-sync-proposal.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,18 @@ Notes on anchored entries:
503503
appeared in an earlier version of the source but are no longer present. No
504504
action needed for those two.
505505

506+
**developer-docs side — postprocessor update when §5 lands:** the current
507+
`externalToInternal` map in `postprocess-motoko.mjs` handles the old
508+
`internetcomputer.org/docs/...` pattern. After §5 replaces those with
509+
`docs.internetcomputer.org/...` paths, add a general prefix rule to the map:
510+
```javascript
511+
['docs.internetcomputer.org/', '/']
512+
```
513+
This single entry rewrites all `docs.internetcomputer.org/<path>` links to
514+
root-relative `/<path>` internal paths, replacing the entire set of specific
515+
entries above. Remove the `internetcomputer.org/docs/...` entries at the same
516+
time — they will no longer appear in the upstream source.
517+
506518
### 6. Use Starlight-native aside types
507519

508520
Replace Docusaurus-only aside types with their Starlight equivalents:

scripts/postprocess-motoko.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,15 @@ const externalToInternal = new Map([
134134
['internetcomputer.org/docs/current/developer-docs/getting-started/development-workflow','/getting-started/quickstart'],
135135

136136
// docs.motoko.org (non-existent domain) → developer-tools page
137-
// Upstream fix tracked as caffeinelabs/motoko#6131 §10.
137+
// Upstream fix (caffeinelabs/motoko#6131 §10) replaces the broken link with
138+
// https://docs.internetcomputer.org/developer-tools/#mo-doc — handle both so
139+
// the rewrite works before and after the upstream change lands.
138140
['docs.motoko.org', '/developer-tools/#mo-doc'],
141+
['docs.internetcomputer.org/developer-tools/#mo-doc', '/developer-tools/#mo-doc'],
142+
// NOTE: when upstream §5 lands (all internetcomputer.org/docs/... links replaced
143+
// with docs.internetcomputer.org/... paths), add a general prefix rule here:
144+
// ['docs.internetcomputer.org/', '/']
145+
// and remove the now-redundant internetcomputer.org/docs/... entries above.
139146

140147
// Motoko-internal links using old portal paths
141148
['internetcomputer.org/docs/motoko/language-manual', '/languages/motoko/reference/language-manual'],

0 commit comments

Comments
 (0)