fix[org]: Keep design options out of new sidebar
This commit is contained in:
parent
755c7395ba
commit
e4c562693c
2 changed files with 8 additions and 8 deletions
|
@ -8,7 +8,6 @@ import { Design } from '@freesewing/core'
|
|||
import yaml from 'js-yaml'
|
||||
import { Pattern } from '@freesewing/react/components/Pattern'
|
||||
import { Xray } from '@freesewing/react/components/Xray'
|
||||
//import { t } from '@freesewing/react-components/methods'
|
||||
import Markdown from 'react-markdown'
|
||||
|
||||
// Get code from children
|
||||
|
|
|
@ -10,12 +10,13 @@ const accountSidebar = { docs: [{ type: 'autogenerated', dirName: '.' }] }
|
|||
* We bundle the options as one page, so keep them out the sidebar
|
||||
*/
|
||||
function hideDesignOptionsFromSidebar(items) {
|
||||
for (const item in items) {
|
||||
if (items[item].label === 'FreeSewing Designs') {
|
||||
for (const design in items[item].items) {
|
||||
for (const subpage in items[item].items[design].items) {
|
||||
if (items[item].items[design].items[subpage].label === 'Design Options') {
|
||||
items[item].items[design].items[subpage].items = []
|
||||
const docs = items.filter((entry) => entry.label === 'Docs').pop().items
|
||||
for (const item in docs) {
|
||||
if (docs[item].label === 'FreeSewing Designs') {
|
||||
for (const design in docs[item].items) {
|
||||
for (const subpage in docs[item].items[design].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: {
|
||||
routeBasePath: '/', //'/docs',
|
||||
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 }) {
|
||||
const sidebarItems = await defaultSidebarItemsGenerator(args)
|
||||
return hideDesignOptionsFromSidebar(sidebarItems)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue