From 074a8a79d73466a144b4265cf32d15d0a82f9a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Kiripolszky?= Date: Thu, 19 Oct 2023 21:36:09 +0200 Subject: [PATCH] Put newest release first (#233) --- docusaurus.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index d8bd89d292..82eed44a4f 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -8,6 +8,8 @@ const katex = require('rehype-katex') require('dotenv').config() +const sortDescending = ['release'] + /** @type {import('@docusaurus/types').Config} */ const config = { title: 'Betaflight', @@ -83,6 +85,11 @@ const config = { 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',*/ remarkPlugins: [math], rehypePlugins: [katex], + async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) { + const sidebarItems = await defaultSidebarItemsGenerator(args) + const mustReverse = sortDescending.includes(args.item.dirName) + return mustReverse ? sidebarItems.reverse() : sidebarItems + }, }, blog: false, theme: {