Open
Description
abstract:
pages can export menus, those get merged into the state.
this allows automagical menu generation.
questions:
? how will we determine page order
- using a 'priority' key in the exported menu object.
no! not easy to change, every page has to be changed without overview over priorities - using /docsrc/app.mjs to export an array with menu item priorities.
no! separates menu order from menu - using an array of strings within app.menu to determine order,
then replace those identifiers with the menu exported from the page.
// /docsrc/pages/page1.mjs
export const state = {
menu: [
{
text: 'page1 link text',
to: '/page1/', // should be derived automagically
items: [
{ text: 'subsection link text', to: '#subsection' },
],
},
],
}
// /docsrc/pages/page2.mjs
export const state = {
menu: {
text: 'page2 link text',
to: '/page2/', // should be derived automagically
],
}
// /docsrc/app.mjs
export const state = {
menu: [
{ text: 'index page link', to: '/' },
['/page2/', '/page1/', '...'],
],
}
Metadata
Metadata
Assignees
Labels
No labels