Docusaurus: Add a config option to allow custom version to be shown first

Created on 22 Dec 2017  路  8Comments  路  Source: facebook/docusaurus

Is this a bug report?

No. Feature request

Have you read the Contributing Guidelines?

Yes.

Environment

N/A

Steps to Reproduce

N/A

Expected Behavior

Add a siteConfig.js option that allows you to explicitly specify a valid version to show by default and then just check for that option when rendering.

Use case:

I looked at the version support of Docusaurus and I think for Relay, we would prefer to have an archived version of the old APIs and latest to make sure doc updates are visible quickly. Currently, when opting in to versions, the latest released version is the default. Could we add an option to make master the default version?

Actual Behavior

N/A

Reproducible Demo

N/A

starter feature

Most helpful comment

Jumping on this band wagon.

Use case:

We have both a stable and beta version on npm at same time. Running npm install will give the user the stable version. However since the versioning in Docusaurus is chronological, then the default version when viewing the docs would be the beta version. Ideally it would be best to show the stable version as the default and then beta users have the option to change.

All 8 comments

Jumping on this band wagon.

Use case:

We have both a stable and beta version on npm at same time. Running npm install will give the user the stable version. However since the versioning in Docusaurus is chronological, then the default version when viewing the docs would be the beta version. Ideally it would be best to show the stable version as the default and then beta users have the option to change.

Hey @JoelMarcey what would I need to do to enable this functionality?

Hey @iRoachie - good to hear from you again. Are you saying enable in terms of creating a PR?

If it's something I can fix sure. Can you at least point me in the right direction?

@iRoachie Can you try this PR out on your site - https://github.com/facebook/Docusaurus/pull/554

Let me know if you get good behavior.

Just add

defaultVersionShown: 'xxxx',

to your siteConfig.js where xxxx is a valid version number for you.

Thanks.

The PR is an RFC, btw. If it is reasonable, we will want to make some more changes, including maybe checks to make sure the version given for defaultVersionShown is valid, etc.

Works great @JoelMarcey. I've had no issues. I even tried running a version(yarn version 1.xx) and the links and everything works as it should

Not yet published, but I just added the commit over at react-native-elements/next.

I have it on a slightly modified fork of Docusaurus that also includes prismjs markdown rendering instead of the default renderer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rickyvetter picture rickyvetter  路  3Comments

JoelMarcey picture JoelMarcey  路  3Comments

sebqq picture sebqq  路  3Comments

nebrelbug picture nebrelbug  路  3Comments

philipmjohnson picture philipmjohnson  路  3Comments