Align topdata wiki canonical paths (#11)

Reviewed-on: https://gitea.westgate.pw/ShadowsOverWestgate/sow-tools/pulls/11
Co-authored-by: Michał Piasecki <mpiasecki720@protonmail.com>
Co-committed-by: Michał Piasecki <mpiasecki720@protonmail.com>
This commit is contained in:
2026-05-23 16:38:02 +02:00
committed by archvillainette
parent 7288d7e2b7
commit 6d6367ad18
6 changed files with 754 additions and 76 deletions
+15 -7
View File
@@ -412,16 +412,24 @@ use `namespace=cid`, for example:
sow-toolkit deploy-wiki --dry-run --namespace spells --category spells=42
```
Namespace declarations in `topdata/wiki/namespaces.yaml` may set
`canonical_path` when a generated namespace lives below a fuller NodeBB category
path, for example `canonical_path: Wiki/Feats`. The `title` remains the display
label, while `canonical_path` drives generated `public_path` metadata, wiki
links, page-index entries, and deploy adoption matching.
When a deploy manifest is missing but matching wiki pages already exist in
NodeBB, `deploy-wiki` checks the Westgate Wiki namespace directory API and
adopts those topic/post mappings before planning updates. It does the same when
a cached manifest mapping points to a post NodeBB no longer has. Generated
public slugs are preferred during adoption before title-based compatibility
matching. `--create` is still required for genuinely new pages that have no
existing remote topic. If NodeBB rejects a create because the clean wiki URL
already exists, `deploy-wiki` re-queries the namespace by page leaf, adopts the
matching topic, and updates it instead. Updates and stale-page archives acquire
a Westgate Wiki edit lock before saving, then send the returned
a cached manifest mapping points to a post NodeBB no longer has. Canonical
`wikiPath`/`canonicalPath` data is preferred during adoption. Nested generated
paths require that exact canonical path data; leaf/title compatibility matching
is only used where it cannot cross a canonical parent path. `--create` is still
required for genuinely new pages that have no existing remote topic. If NodeBB
rejects a create because the clean wiki URL already exists, `deploy-wiki`
re-queries the namespace by page leaf, adopts the matching topic, and updates it
instead. Updates and stale-page archives acquire a Westgate Wiki edit lock
before saving, then send the returned
`wikiEditLockToken` with the NodeBB post edit request. Stale generated pages are
reported by default.
`--stale-policy archive` rewrites stale generated pages in place as archived