-
Notifications
You must be signed in to change notification settings - Fork 64
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
🗂 Add site option to include folder structure in url paths #1601
Conversation
🦋 Changeset detectedLatest commit: 11889fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -57,9 +57,13 @@ export async function loadProjectFromDisk( | |||
let newProject: Omit<LocalProject, 'bibliography'> | undefined; | |||
let { index, writeTOC } = opts || {}; | |||
let legacyToc = false; | |||
const siteConfig = selectors.selectLocalSiteConfig(state, path); | |||
const urlFolders = !!siteConfig?.options?.url_folders; |
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 happy to take suggestions about a better name for this option...
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.
@fwkoch do we have a policy about snake_case
vs pascalCase
for frontmatter/config item names?
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.
snake case for items in config data files (.yml), and so they also leak into typescript in places. Everything else is PascalCase
(classes) / camelCase
(fns, vars).
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.
lets do site.folders
and get around it!
@fwkoch seems like there will be no impact on the |
@stevejpurves - yeah, |
@@ -57,9 +57,13 @@ export async function loadProjectFromDisk( | |||
let newProject: Omit<LocalProject, 'bibliography'> | undefined; | |||
let { index, writeTOC } = opts || {}; | |||
let legacyToc = false; | |||
const siteConfig = selectors.selectLocalSiteConfig(state, path); | |||
const urlFolders = !!siteConfig?.options?.url_folders; |
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.
lets do site.folders
and get around it!
This PR adds an option to support nested folder structure in URLs. See #670
This uses an option at the
site
level of yourmyst.yml
-site.options.url_folders: true
. Given this option, slugs are computed to contain dot-delimited folder structure (as opposed to the previous behavior where slugs were computed entirely based on filename). Consuming these new slugs with folders requires an updated myst theme, see jupyter-book/myst-theme#489 (without the updated theme, the dots in the slugs will just show up in your MyST site; with the updated theme, your site URLs will have slashes instead of dots)