Short pathes #2052
Replies: 3 comments 3 replies
-
|
Hi, @stereobooster ! Would Astro redirects work for you? This would allow you to have the structure you're wanting while retaining the same file structure (or the opposite scenario!) |
Beta Was this translation helpful? Give feedback.
-
|
In this area Starlight is mostly limited by how Astro itself manages slugs etc. with content collections. Might be something that could become more flexible with Astro’s work on a new “content layer” API extending content collections — withastro/roadmap#946 |
Beta Was this translation helpful? Give feedback.
-
|
Starting with Starlight 0.35.0, a new For example, the following code snippet will remove the docsLoader({
// Remove the `.md` or `.mdx` extension, but otherwise don’t process filenames.
generateId: ({ entry }) => entry.split('.').slice(0, -1).join('.'),
}),This is a basic example but it could be used to dynamically identify if the entry is part of the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of
starlightare you using?0.24.0
What is your idea?
Ability to configure Starlight to use "short" urls. For example, if I have following files structure:
I want Starlight to generate URLs like this:
/backlinksinstead of/reciepes/backlinks/diagramsinstead of/reciepes/diagramsBut the same time I would like sidebar to preserve structure.
I can achieve this by using
slugin frontmatter:But I was wondering, if there is a way to make this configuration, so I would not need to place it in every file. Maybe I can configure Astro content (schema) some how?
Why is this feature necessary?
Because I want to move files around without breaking URLs. I could theoretically dump all files at root level, but in this case Sidebar looks pretty bad.
And yes I know that I would need to make sure to have unique file names in this case. And probably this is not the feature that a lot of people would use. But a workaround or plugin would do too - not necessary built-in feature.
Do you have examples of this feature in other projects?
No response
Participation
Beta Was this translation helpful? Give feedback.
All reactions