.agents/skills/learn-site-structure/recipes/delete-doc-page.md
The only recipe that requires manual surgery in the learn repo. Deletion does NOT auto-redirect -- without the manual step, the old URL serves a 404.
The canonical reference for this recipe is
<repo>/docs/.map/README.md:96-104.
Before deleting, decide one of:
You'll apply the decision in step 4.
In this repo:
.md file.<repo>/docs/.map/map.yaml and remove the matching
node.After this PR merges, ingest's next run produces a "Ingest
New Documentation" PR in the learn repo that DOES NOT
auto-redirect the old URL (because the GH source URL no
longer points to a real file, the UpdateGHLinksBasedOnMap
step can't resolve it).
Once the ingest PR is merged (or BEFORE if you want to bundle the surgery with the ingest PR -- see step 4 alternative):
${NETDATA_REPOS_DIR}/learn/LegacyLearnCorrelateLinksWithGHURLs.json."https://github.com/netdata/netdata/blob/master/docs/<...>/<deleted-page>.md"
https://learn.netdata.cloud/docs/<replacement>).Save the file.
Alternative: if you want a one-off manual [[redirects]]
rule (for example, to redirect to an entirely external
domain), edit ${NETDATA_REPOS_DIR}/learn/static.toml and
add a hand-rolled entry under # section: static. This
gets copied into netlify.toml on the next ingest.
Title: manual redirect surgery for deleted page <name>. PR
body explains what was deleted, where the redirect goes, and
why.
After Netlify deploys:
# If you redirected to replacement:
curl -sI https://learn.netdata.cloud<old-path>
# Expect: HTTP/2 301
# Location: https://learn.netdata.cloud<replacement-path>
# If you dropped:
curl -sI https://learn.netdata.cloud<old-path>
# Expect: HTTP/2 404
Daily link checker: the daily
${NETDATA_REPOS_DIR}/learn/.github/workflows/daily-learn-link-check.yml
cron will start failing if it finds a learn_link:
pointing at the deleted page. To minimize noise, do step 3
promptly after step 2.
Internal links from other Learn pages: search
${NETDATA_REPOS_DIR}/learn/docs/ and this repo's <repo>/docs/
for explicit links to the deleted page's URL and update them.
The link rewriter (step 12 of the ingest pipeline) will
flag broken internal links during ingest if you missed any.
If you re-publish later: the redirect entry can stay
in LegacyLearnCorrelateLinksWithGHURLs.json. The
UpdateGHLinksBasedOnMap step will re-resolve the GH URL
through the new map and route the old URL to the new
destination automatically. So if you later add a similar
page back, the old URL keeps working with no further
surgery.
netlify.toml directly. Regenerated each
ingest. Edit static.toml (for hand-curated static rules)
or LegacyLearnCorrelateLinksWithGHURLs.json (for the
dynamic catalog).part_of_learn: True page. That's a
hand-authored learn-repo page (currently only
docs/ask-nedi.mdx). Deleting it requires editing the
learn repo directly, NOT this repo's map.yaml. And the
home page redirects to it -- removing it breaks the site
root..md directly. Edit the source metadata.yaml
to remove the integration (or change its category) -- see
the integrations-lifecycle skill.