Skip to content

Looking for a way to preserve old links #1951

@zachdaniel

Description

@zachdaniel

Hey folks! I'm looking for a way to preserve old links even as documentation changes. As our project evolves, many things change, pages move, modules are renamed, etc. For now, I've added a "this page has moved" extra for one of our extras that has moved that was popular before. However, this sort of thing can also happen for modules, mix tasks, etc.

Two proposals for how this might be resolved:

Explicit moved_pages config

We add a configuration in ex_doc called moved_pages, which would create pages that are not displayed in the sidebar (and probably not in search?) that simply show a message that a given page has been moved, like so:

moved_pages: %{
  "upgrade.html" => "upgrading-to-3.0.html"
}

Since this uses the html route, it can work for modules/mix tasks/anything else.

Add the ability to hide pages in the sidebar

This would only work for extras, since we don't want to leave dead code in a project just for the sake of documentation purposes, but with extras that would be fine. So we could do something like:

extras: [{"Extra", sidebar: false}]

Then if something moves, you can just leave the old page there but hidden in the sidebar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions