Skip to content

Commit

Permalink
feat: add version dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Dec 21, 2021
1 parent 127aac2 commit d0fa714
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions SeaORM/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
const versions = require('./versions.json');

function getNextMinorVersionName() {
const minorVersion = parseInt(versions[0].split('.')[1], 10);
return `0.${minorVersion + 1}.x`;
}

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'SeaORM - 🐚 An async & dynamic ORM for Rust',
Expand Down Expand Up @@ -41,6 +48,12 @@ module.exports = {
label: 'GitHub',
position: 'right',
},
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,

},
],
},
footer: {
Expand Down Expand Up @@ -111,6 +124,11 @@ module.exports = {
editUrl: 'https://github.com/SeaQL/seaql.github.io/edit/master/SeaORM/',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
versions: {
current: {
label: `${getNextMinorVersionName()} 🚧`,
},
},
},
blog: {
showReadingTime: true,
Expand Down

0 comments on commit d0fa714

Please sign in to comment.