Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mike alias name to version selector #6436

Closed
4 tasks done
corykinney opened this issue Dec 4, 2023 · 3 comments
Closed
4 tasks done

Add mike alias name to version selector #6436

corykinney opened this issue Dec 4, 2023 · 3 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@corykinney
Copy link

Context

I searched through the documentationa nd previous issues and couldn't find anything, hopefully I didn't miss anything.

Description

Currently the version selector shows the identifiers for the documentation versions deployed with mike. If it's not difficult to implement, I would suggest adding a toggle to allow displaying the alias for a version in parentheses in the version selector. Example:

0.3 (dev)
0.2 (stable)
0.1

Related links

Use Cases

This would provide clarity when documentation for the development branch is available, so that the user understands why the default version served is not the highest version number.

Visuals

No response

Before submitting

@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Dec 5, 2023
@squidfunk
Copy link
Owner

Thanks for suggesting. We can investigate this reasonable feature request in the future.

@squidfunk
Copy link
Owner

Added in cc398dd. There's a new setting in mkdocs.yml which will show the first version alias (according to mike, there can be multiple), if one is given. It can be enabled with the following configuration:

extra:
  version:
    provider: mike
    alias: true

Here's how it looks:

screenshot-localhost-3000-getting-started-1715786621697

I tried to make the styles as less opinionated as possible. If you wish to customize them, it's easy with some additional CSS. For example, if you want to add ( and ) before and after the alias, you can use:

.md-version__alias::before {
  display: inherit;
  content: "(";
}
.md-version__alias::after {
  display: inherit;
  content: ")";
}

You can also change the style by playing with .md-version__alias.

@squidfunk squidfunk added resolved Issue is resolved, yet unreleased if open and removed needs investigation Issue must be investigated by the maintainers labels May 15, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants