Description
The documentation Markdown metadata has the slug
parameter, which indicates under which URL the page is published in docs.
The problem is, when the slug is changed, the old slug URL breaks, unless you add it manually to the nginx configuration, which is messy, contains duplicate entries, and multiple redirections, so e.g. a link to https://docs.apify.com/scraping leads you to a totally irrelevant page https://docs.apify.com/platform/actors/running. This is hard to manage and causes more broken links: https://charts.apify.com/dashboards/147-documentation
For context, see https://apifier.slack.com/archives/CQ96RHG2U/p1701348240817199
The solution would be to extend the slug functionality, to enable adding multiple comma- or space-seperated URLs, such as
---
title: Getting started with Apify scrapers
menuTitle: Getting started
...
slug: /apify-scrapers/getting-started, /scraping/tutorial, /something-else
---
The docs engine would consider the first slug
URL as the primary one, and the other URLs would 301 redirect to it. This way, the writers of docs can easily and safely ensure the URLs don't get broken over time - they would be required to always add to the slug
, but don't remove URLs.
In case there's a conflict, e.g. multiple pages point to the same URL, the docs build process should throw an error.
Together with this task, we should also migrate the nginx config settings to this new feature.