Skip to content

Support additional versioning schemes #8453

@evankanderson

Description

@evankanderson

Context

We (https://knative.dev) are generally pretty happy with Material MkDocs, but the versioning support doesn't quite work for us. Rather than using mike with GitHub Pages, we're using Netlify, and checking out several versions of the documentation and building each time.

This mostly works, except that the version navigation is based on the mike assumption that the version navigation happens between complete copies of the site, while we only want versioned navigation within the technical documentation, but not in the "About", "Community", etc sections ("marketing content").

The site nav would look something like:

nav:
- docs
- about
- blog
- community
- Docs: development
- Docs: v1.18-docs
- Docs: v1.17-docs

Description

In addition to the current mike provider behavior, I'd like to add a directory or similar provider which determines the version and equivalent sitemap using a different base url than config.base

I'd be willing to submit a PR for this, but I wanted to judge interest before creating a PR.

Related links

I also saw the blog post about improving translation and versioning support -- tying these together makes some sense to me, but I'd like to be able to make some small improvements before the complete rebuild of navigation is done.

Use Cases

We use (and love the design and philosophy of) Material MkDocs for our website, which has multiple audiences:

  1. Decision makers learning what the project is about and whether to use it ("marketing" content)
  2. Developers using the interfaces provided by the project to run their own applications
  3. Administrators figuring out how to install the software on a Kubernetes cluster

For users in the (1) role, versioning is not really helpful, as we'd like changes to things like governance or testimonials to give live immediately. For users in the (2) and (3) roles, versioned documentation can be very helpful to understand the capabilities of the version that they are running, but we want to steer users towards installing or updating to the latest version, as that's the one that gets the most support.

Visuals

We have some slightly funky navigation on https://knative.dev/, but we'd roughly like the top level nav to look like:

nav:
  - Home: /
  - Docs[version]: /$version-slug/
  - About: /about
  - Blog: /blog
  - Community: /community

Where only the "Docs" heading would show the version chooser, and would choose between the different version slugs. I haven't thought deeply about how to represent this; we currently have a hand-coded top nav, but would like to steer back towards more-common mkdocs styles.

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions