From 97b129e0fafb32aad1562c5b0beb5ab7dace546c Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 22 May 2023 17:17:11 +1000 Subject: [PATCH] auto-generate sidebar and add category config to resources --- docs/index.md | 1 + docs/ox_core/Getting Started/index.md | 1 - docs/ox_core/_category_.yml | 7 + docs/ox_doorlock/_category_.yml | 6 + docs/ox_fuel/_category_.yml | 6 + docs/ox_inventory/Getting Started/index.md | 3 +- docs/ox_inventory/_category_.yml | 6 + docs/ox_lib/_category_.yml | 7 + docs/ox_target/Getting Started/index.md | 1 - docs/ox_target/_category_.yml | 6 + docs/oxmysql/Getting Started/index.md | 4 - docs/oxmysql/_category_.yml | 7 + sidebars.js | 231 ++++++--------------- 13 files changed, 105 insertions(+), 181 deletions(-) create mode 100644 docs/ox_core/_category_.yml create mode 100644 docs/ox_doorlock/_category_.yml create mode 100644 docs/ox_fuel/_category_.yml create mode 100644 docs/ox_inventory/_category_.yml create mode 100644 docs/ox_lib/_category_.yml create mode 100644 docs/ox_target/_category_.yml create mode 100644 docs/oxmysql/_category_.yml diff --git a/docs/index.md b/docs/index.md index 55d6dbf5..a9e35605 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,6 @@ --- title: Home +sidebar_position: 1 --- Here you can find all of the official documentation for resources developed by the Overextended team diff --git a/docs/ox_core/Getting Started/index.md b/docs/ox_core/Getting Started/index.md index 88905cdc..7302a7ae 100644 --- a/docs/ox_core/Getting Started/index.md +++ b/docs/ox_core/Getting Started/index.md @@ -1,7 +1,6 @@ --- title: Getting started sidebar_position: 1 -slug: ./../ --- import ResourceLinks from '@site/src/components/ResourceLinks'; diff --git a/docs/ox_core/_category_.yml b/docs/ox_core/_category_.yml new file mode 100644 index 00000000..a4dde0b3 --- /dev/null +++ b/docs/ox_core/_category_.yml @@ -0,0 +1,7 @@ +label: Ox Core +collapsible: true +collapsed: true +link: + type: generated-index + description: An experimental framework for FiveM. Limited support and breaking changes guaranteed. +position: 4 diff --git a/docs/ox_doorlock/_category_.yml b/docs/ox_doorlock/_category_.yml new file mode 100644 index 00000000..3cc6224a --- /dev/null +++ b/docs/ox_doorlock/_category_.yml @@ -0,0 +1,6 @@ +label: Ox Doorlock +collapsible: true +collapsed: true +link: + type: generated-index + description: A door management resource that can be used standalone or alongside ox_core, qb-core, and es_extended. diff --git a/docs/ox_fuel/_category_.yml b/docs/ox_fuel/_category_.yml new file mode 100644 index 00000000..543af2dc --- /dev/null +++ b/docs/ox_fuel/_category_.yml @@ -0,0 +1,6 @@ +label: Ox Fuel +collapsible: true +collapsed: true +link: + type: generated-index + description: A simple fuel resource meant to replace LegacyFuel or serve as a showcase for using petrol cans as an item. diff --git a/docs/ox_inventory/Getting Started/index.md b/docs/ox_inventory/Getting Started/index.md index 23cfb63e..c2ed6c8f 100644 --- a/docs/ox_inventory/Getting Started/index.md +++ b/docs/ox_inventory/Getting Started/index.md @@ -1,7 +1,6 @@ --- -title: Getting Started +title: Getting started sidebar_position: 1 -slug: ./../ --- import ResourceLinks from '@site/src/components/ResourceLinks'; diff --git a/docs/ox_inventory/_category_.yml b/docs/ox_inventory/_category_.yml new file mode 100644 index 00000000..891ddfc8 --- /dev/null +++ b/docs/ox_inventory/_category_.yml @@ -0,0 +1,6 @@ +label: Ox Inventory +collapsible: true +collapsed: true +link: + type: generated-index + description: An slot-based inventory with item metadata for "item uniqueness". diff --git a/docs/ox_lib/_category_.yml b/docs/ox_lib/_category_.yml new file mode 100644 index 00000000..2f37f3bc --- /dev/null +++ b/docs/ox_lib/_category_.yml @@ -0,0 +1,7 @@ +label: Ox Lib +collapsible: true +collapsed: true +link: + type: generated-index + description: A standalone library for providing easily reusable code as importable modules and exports. +position: 3 diff --git a/docs/ox_target/Getting Started/index.md b/docs/ox_target/Getting Started/index.md index 5ceab916..3f88caf3 100644 --- a/docs/ox_target/Getting Started/index.md +++ b/docs/ox_target/Getting Started/index.md @@ -1,7 +1,6 @@ --- title: Getting started sidebar_position: 1 -slug: ./../ --- ## Installation diff --git a/docs/ox_target/_category_.yml b/docs/ox_target/_category_.yml new file mode 100644 index 00000000..53857279 --- /dev/null +++ b/docs/ox_target/_category_.yml @@ -0,0 +1,6 @@ +label: Ox Target +collapsible: true +collapsed: true +link: + type: generated-index + description: A performant and flexible standalone targeting resource or "third-eye", with additional functionality for ox_inventory, ox_core, qb-core, and es_extended. diff --git a/docs/oxmysql/Getting Started/index.md b/docs/oxmysql/Getting Started/index.md index 3f723afa..80d07659 100644 --- a/docs/oxmysql/Getting Started/index.md +++ b/docs/oxmysql/Getting Started/index.md @@ -1,7 +1,3 @@ ---- -slug: ./../ # Sets the url to /docs/oxmysql/ ---- - # Getting Started ## MySQL or MariaDB? diff --git a/docs/oxmysql/_category_.yml b/docs/oxmysql/_category_.yml new file mode 100644 index 00000000..7fe79dbd --- /dev/null +++ b/docs/oxmysql/_category_.yml @@ -0,0 +1,7 @@ +label: OxMySQL +collapsible: true +collapsed: true +link: + type: generated-index + description: A drop-in replacement of mysql-async and ghmattimysql with expanded API and improved compatibility for MySQL 8. +position: 2 diff --git a/sidebars.js b/sidebars.js index 913270e0..2855045c 100644 --- a/sidebars.js +++ b/sidebars.js @@ -14,181 +14,66 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure - // tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + tutorialSidebar: [ + { + type: 'autogenerated', + dirName: '.', + }, + ], // But you can create a sidebar manually - docs: [ - { - type: 'doc', - label: 'Home', - id: 'index', - }, - { - type: 'link', - label: 'Core', - href: '/docs/ox_core', - }, - { - type: 'link', - label: 'MySQL', - href: '/docs/oxmysql', - }, - { - type: 'link', - label: 'Library', - href: '/docs/ox_lib', - }, - { - type: 'link', - label: 'Target', - href: '/docs/ox_target', - }, - { - type: 'link', - label: 'Inventory', - href: '/docs/ox_inventory', - }, - { - type: 'link', - label: 'Doorlock', - href: '/docs/ox_doorlock', - }, - ], - ox_target: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'Target', - link: { - type: 'generated-index', - title: 'Ox Target', - description: 'A performant and flexible "third-eye" stand-alone targeting resource, with additional support for ox, esx, and qb.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'ox_target', - }, - ], - }, - ], - ox_core: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'Core', - link: { - type: 'generated-index', - title: 'Ox Core', - description: 'An experimental framework for FiveM. Limited support and breaking changes guaranteed.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'ox_core', - }, - ], - }, - ], - oxmysql: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'OxMySQL', - link: { - type: 'generated-index', - title: 'OxMySQL', - description: - 'MySQL/MariaDB wrapper for FXServer built on the node-mysql2 connector, offering improved performance and functionality.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'oxmysql', - }, - ], - }, - ], - ox_lib: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'Library', - link: { - type: 'generated-index', - title: 'Ox Library', - description: 'Provides shared code through exports and loadable modules to utilise in other resources.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'ox_lib', - }, - ], - }, - ], - ox_inventory: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'Inventory', - link: { - type: 'generated-index', - title: 'Ox Inventory', - description: - 'A slot-based inventory with metadata support, implementing its own items, weapons, shops, and more.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'ox_inventory', - }, - ], - }, - ], - ox_doorlock: [ - { - type: 'link', - label: '← Home', - href: '/docs', - }, - { - type: 'category', - label: 'Doorlock', - link: { - type: 'generated-index', - title: 'Ox Doorlock', - description: - 'Door management resource.', - }, - items: [ - { - type: 'autogenerated', - dirName: 'ox_doorlock', - }, - ], - }, - ], + // docs: [ + // { + // type: 'doc', + // label: 'Documentation', + // id: 'index', + // }, + // { + // type: 'category', + // label: 'Core', + // link: { + // type: 'generated-index', + // title: 'Ox Core', + // description: 'An experimental framework for FiveM. Limited support and breaking changes guaranteed.', + // }, + // items: [ + // { + // type: 'autogenerated', + // dirName: 'ox_core', + // }, + // ], + // }, + // { + // type: 'category', + // label: 'MySQL', + // items: [ + // { + // type: 'autogenerated', + // dirName: 'oxmysql', + // }, + // ], + // }, + // { + // type: 'category', + // label: 'Library', + // items: [ + // { + // type: 'autogenerated', + // dirName: 'ox_lib', + // }, + // ], + // }, + // { + // type: 'category', + // label: 'Inventory', + // items: [ + // { + // type: 'autogenerated', + // dirName: 'ox_inventory', + // }, + // ], + // }, + // ], }; module.exports = sidebars;