Skip to content

Readme metadata "slug" option should support multiple URLs, with automated redirects to the main URL #773

Open
@jancurn

Description

@jancurn

The documentation Markdown metadata has the slug parameter, which indicates under which URL the page is published in docs.

image

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.

Metadata

Metadata

Assignees

Labels

contentContent writing, help to marketing, and other related tasks.documentationImprovements or additions to documentation.enhancementNew feature or request.t-docsIssues owned by technical writing team.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions