-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
This is a suggestion, not a bug.
Given that one of the project’s goals is:
Intuitive directory-based URLs. The URL of a page is derived from its spot on the file system.
...it seems odd that the path attribute in the front-matter of an index.md file is always treated as absolute.
Imagine I have a directory structure:
/pages
/writes
/1-hello-world
index.md
/another-page
index.md
And the front-matter of /pages/writes/1-hello-world/index.md
includes:
path: "hello-world"
(note the lack of starting “/”)
Based on the goal quoted above, I'd expect the resulting URL to be /writes/hello-world
. Currently, though, the resulting URL is /hello-world
.
I realize I can simply leave off the path attribute (which results in /writes/1-hello-world
), but I like using a preceding number or date to keep the pages in the correct order in the filesystem, and I would like that number or date to not be in the URL. Right now, the workaround is to add a path like “writes/hello-world”.
For people that like the current behavior, using an absolute instead of relative path could provide that.
I’m just diving into this stuff, but if someone can point me in the right direction, I’ll try to investigate further toward an eventual PR.
I also realize this is breaking change, so maybe it should just stay as-is.