1
0
Fork 0

fix[org]: Keep design options out of new sidebar

This commit is contained in:
joostdecock 2024-12-14 11:40:40 +01:00
parent 755c7395ba
commit e4c562693c
2 changed files with 8 additions and 8 deletions

View file

@ -8,7 +8,6 @@ import { Design } from '@freesewing/core'
import yaml from 'js-yaml' import yaml from 'js-yaml'
import { Pattern } from '@freesewing/react/components/Pattern' import { Pattern } from '@freesewing/react/components/Pattern'
import { Xray } from '@freesewing/react/components/Xray' import { Xray } from '@freesewing/react/components/Xray'
//import { t } from '@freesewing/react-components/methods'
import Markdown from 'react-markdown' import Markdown from 'react-markdown'
// Get code from children // Get code from children

View file

@ -10,12 +10,13 @@ const accountSidebar = { docs: [{ type: 'autogenerated', dirName: '.' }] }
* We bundle the options as one page, so keep them out the sidebar * We bundle the options as one page, so keep them out the sidebar
*/ */
function hideDesignOptionsFromSidebar(items) { function hideDesignOptionsFromSidebar(items) {
for (const item in items) { const docs = items.filter((entry) => entry.label === 'Docs').pop().items
if (items[item].label === 'FreeSewing Designs') { for (const item in docs) {
for (const design in items[item].items) { if (docs[item].label === 'FreeSewing Designs') {
for (const subpage in items[item].items[design].items) { for (const design in docs[item].items) {
if (items[item].items[design].items[subpage].label === 'Design Options') { for (const subpage in docs[item].items[design].items) {
items[item].items[design].items[subpage].items = [] if (docs[item].items[design].items[subpage].label === 'Design Options') {
docs[item].items[design].items[subpage].items = []
} }
} }
} }
@ -198,7 +199,7 @@ const config = {
docs: { docs: {
routeBasePath: '/', //'/docs', routeBasePath: '/', //'/docs',
sidebarPath: './sidebars.js', sidebarPath: './sidebars.js',
editUrl: 'https://github.com/freesewing/freesewing/tree/main/sites/dev/', editUrl: 'https://github.com/freesewing/freesewing/tree/v4/sites/org/',
async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) { async sidebarItemsGenerator({ defaultSidebarItemsGenerator, ...args }) {
const sidebarItems = await defaultSidebarItemsGenerator(args) const sidebarItems = await defaultSidebarItemsGenerator(args)
return hideDesignOptionsFromSidebar(sidebarItems) return hideDesignOptionsFromSidebar(sidebarItems)