.agents/skills/learn-site-structure/recipes/rename-doc-page.md
Rename a page (change its display name in the sidebar / URL).
Functionally identical to a move because the URL slug is
derived from meta.label. Auto-redirected.
Open <repo>/docs/.map/map.yaml. Find the node and change
meta.label:
# Before
- meta:
label: Old Name
edit_url: https://github.com/netdata/netdata/edit/master/docs/x/page.md
# After
- meta:
label: New Name
edit_url: https://github.com/netdata/netdata/edit/master/docs/x/page.md
edit_url stays unchanged (source file is still the same
file).
If you want the source file to also have a new name (cleaner),
rename it in this repo AND update meta.edit_url to match.
Two scenarios:
LegacyLearnCorrelateLinksWithGHURLs.json still has it
pointing at the new URL via the previous-run snapshot.
This works for ONE rename cycle. If you rename again later,
the chain may break -- so prefer to keep edit_url stable.cd ${NETDATA_REPOS_DIR}/learn
. venv/bin/activate
python3 ingest/ingest.py --local-repo netdata:<repo> \
--ignore-on-prem-repo --fail-links-netdata
Check that the auto-redirect is generated. See
../redirects.md.
map.yaml change (and source file rename if applicable).
Reviewers check the edit_url regex and that the rename
makes sense.
Same flow as move/add: 0-3 hour cron + ingest PR + manual merge + Netlify deploy.
# Old URL redirects to new
curl -sI https://learn.netdata.cloud<old-path> # expect 301
# New URL works
curl -sI https://learn.netdata.cloud<new-path> # expect 200
<learn_rel_path>/<sanitized-label>, with spaces -> -,
// -> /. So Old Name -> old-name, New Name ->
new-name.sidebar_label (with
case preserved + only certain chars stripped). So
${NETDATA_REPOS_DIR}/learn/docs/x/Old Name.mdx becomes
New Name.mdx. This is normal and ingest handles it.<repo>/docs/...).meta.label to something with /, (, ),
,, ', backtick, or : -- those characters get
stripped by the slug sanitizer. Pick a label that survives
cleanup.slug: override in source
frontmatter. The auto-redirect mechanism is bypassed
(slug override wins). You'll need manual JSON surgery
similar to the delete recipe.