Skip to content

Respect the configured default in the version selector #209

Description

@j178

Context

Some projects serve the latest release directly from unversioned URLs while also publishing versioned documentation with mike. For example, prek's documentation root serves the same documentation as the latest release and configures extra.version.default: latest.

Description

When the current URL does not match a version or alias in versions.json, the version selector should try the configured default version and its aliases before falling back to the first entry. Exact URL matches should remain higher priority. If no default is configured, latest should remain the implicit default.

Related links

Use Cases

At the time of writing, the unversioned root at prek.j178.dev serves version 0.4.14, which has the latest alias. Because dev is the first entry in versions.json, the selector currently shows dev. With the proposed fallback, the root would show 0.4.14 (latest), while /dev/ and all versioned URLs would continue to use their exact URL matches.

This also lets other projects keep stable, unversioned documentation URLs without making the selector depend on the ordering of versions.json. Sites whose URLs already match a version are unchanged, and sites without a matching configured default retain the existing first-entry fallback.

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions