-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable navigation #118
Conversation
af5ffb2
to
9a54d0a
Compare
9a54d0a
to
87b7de7
Compare
pages?: RenderOptions["pages"]; | ||
} | ||
|
||
export async function readConfig(root: string): Promise<Config | undefined> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is intended to be a general config for the CLI, or it is just for the TOC? Would we want to be database config or other non-content options in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s a config file for this project in the same fashion as VitePress, e.g.,
https://github.com/observablehq/plot/blob/main/docs/.vitepress/config.ts
docs/.observablehq/config.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Platform work for observable deploy
will need to store some per-project configuration values, like which project we should deploy into. Do you think that information should be in this file, or elsewhere?
If we want to put that kind of configuration in this file, it would be nice if we could programmatically modify the settings file, which would be difficult to do for JS/TS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s a good question. Maybe anything auto-generated would need to live in a separate file. Eventually I can see us wanting to have plugins and dynamic behavior in the config file, so it’s nice to keep the config in code.
Loads a config.ts (or config.js) file from docs/.observablehq. Fixes #44.
For now, this is still just a flat list of pages, but it allows us to control the order and edit the titles that appear in the side bar. I can file a separate issue for hierarchical and collapsible sections in the sidebar.
I’ve also included in this PR a restructuring and more extensive scaffolding of the documentation #74. Because this adds many more pages, we want configurable navigation to keep the sidebar organized. I can break the documentation out into a downstream PR if needed, but please see src/config.ts and src/navigation.ts for the functional changes.