URL schema for pages #2201

Closed
opened 2026-02-05 03:17:59 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @TH3UNKN0WN-1337 on GitHub (Apr 19, 2021).

We would like to have better, readable URLs.

Right now BookStacks generates URLs for pages like the following:
{baseUrl}/books/{bookName}/pages/{pageName}[-XXX]

We would like to have a URL scheme like the following:
{baseUrl}/{shelveName}/{bookName}/{chapterName}/{pageName}
{baseUrl}/shelves/{shelveName}/books/{bookName}/chapters/{chapterName}/pages/{pageName}

It may would not benefit the BookStack user itself, but we for example use BookStack to share documetation links to internal customers. And whenever two pages inside the same book have the same name the URL gets a random generated postfix {-XXX} behind it. As a work-around you could add a prefix before everything, for example:
BookName: ChatperName
ChapterName: BookName
But when looking at the generated PDF document it looks just not good, especially the chapters overview.

Is it possibleto make a change in the underlying MVC-Route, to optional change the URL schema?

Originally created by @TH3UNKN0WN-1337 on GitHub (Apr 19, 2021). We would like to have better, readable URLs. Right now BookStacks generates URLs for pages like the following: {baseUrl}/books/{bookName}/pages/{pageName}[-XXX] We would like to have a URL scheme like the following: {baseUrl}/{shelveName}/{bookName}/{chapterName}/{pageName} {baseUrl}/shelves/{shelveName}/books/{bookName}/chapters/{chapterName}/pages/{pageName} It may would not benefit the BookStack user itself, but we for example use BookStack to share documetation links to internal customers. And whenever two pages inside the same book have the same name the URL gets a random generated postfix {-XXX} behind it. As a work-around you could add a prefix before everything, for example: BookName: ChatperName ChapterName: BookName But when looking at the generated PDF document it looks just not good, especially the chapters overview. Is it possibleto make a change in the underlying MVC-Route, to optional change the URL schema?
Author
Owner

@ssddanbrown commented on GitHub (Apr 19, 2021):

Thanks for the request @TH3UNKN0WN-1337,

We won't really look to use the shelf as part of the URL path since a page can be in many shelves and since shelves are an optional component.

The URLs generated are quite an opinionated element, from the feedback I've seen so far many would prefer to have URLs simpler than currently defined, with less text in the URL.

Just to confirm, is the requested scheme just due to get around the auto generated component of the URL slug on duplicates? If so may I ask why this is problematic in your instance?

@ssddanbrown commented on GitHub (Apr 19, 2021): Thanks for the request @TH3UNKN0WN-1337, We won't really look to use the shelf as part of the URL path since a page can be in many shelves and since shelves are an optional component. The URLs generated are quite an opinionated element, from the feedback I've seen so far many would prefer to have URLs simpler than currently defined, with less text in the URL. Just to confirm, is the requested scheme just due to get around the auto generated component of the URL slug on duplicates? If so may I ask why this is problematic in your instance?
Author
Owner

@TH3UNKN0WN-1337 commented on GitHub (Apr 19, 2021):

Hello and thanks for your fast reply @ssddanbrown!

I totally forgot about the optional shelf part. I also agree that’s this topic is very opinionated.

Well, basically it’s about the auto generated slug at the end of the page URL when two pages in a book have the same name.
maybe it sounds weird, but it’s just a esthetic thing mine/our management noted.

I was thinking a bit about WordPress and how these guys offer options to define the routes for pages. Maybe a configurable option would be a thing?

Sadly I’m not familiar with PHP and so I’m not able to just change it myself inside the source to use another routing scheme.

Hopefully my feature request is now more clear and understandable.

Greetings from Germany and thanks for sour great product,
Mirko

@TH3UNKN0WN-1337 commented on GitHub (Apr 19, 2021): Hello and thanks for your fast reply @ssddanbrown! I totally forgot about the optional shelf part. I also agree that’s this topic is very opinionated. Well, basically it’s about the auto generated slug at the end of the page URL when two pages in a book have the same name. maybe it sounds weird, but it’s just a esthetic thing mine/our management noted. I was thinking a bit about WordPress and how these guys offer options to define the routes for pages. Maybe a configurable option would be a thing? Sadly I’m not familiar with PHP and so I’m not able to just change it myself inside the source to use another routing scheme. Hopefully my feature request is now more clear and understandable. Greetings from Germany and thanks for sour great product, Mirko
Author
Owner

@ssddanbrown commented on GitHub (Dec 16, 2021):

Thanks for following up with detail.

I'm going to close this off since including the chapter component has already been requested as part of #497.
Realistically, I'd look to make more substantial changes in the future to accommodate a wider set of requests, so while I don't think it's likely we'll just add in chapter to the URLs, they could be part of a future scheme.

@ssddanbrown commented on GitHub (Dec 16, 2021): Thanks for following up with detail. I'm going to close this off since including the chapter component has already been requested as part of #497. Realistically, I'd look to make more substantial changes in the future to accommodate a wider set of requests, so while I don't think it's likely we'll just add in chapter to the URLs, they could be part of a future scheme.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2201