[Feature] Permalink Settings UI
See original GitHub issueThe current Permalink Settings UI is just a checkbox to switch between WP style and Ghost style permalinks. But Ghost is capable of supporting many, many more formats. In order to make these formats accessible, we are going to add a new UI to the general settings pane that is going to look something like this:
In order to ship this, the following tasks need to be completed:
- Code up the UI in HTML & CSS
#3920Mockup here - Mockup needs fixing / would be good to have a gif showing how it is supposed to work
#4454 - Wire up the new UI as an ember component which replaces the existing checkbox (issue #4484)
- Implement validation on the client and server to ensure that only valid permalinks can be created with the UI and saved in the DB (issue #4486)
- Ensure the frontend correctly handles various permalinks https://github.com/TryGhost/Ghost/issues/4322, which depended on ~~https://github.com/TryGhost/Ghost/issues/4445~~
Ghost Permalink Spec
The details of what permalink formats we support were originally covered by https://github.com/TryGhost/Ghost/issues/2057 and extended by https://github.com/TryGhost/Ghost/issues/3858
The full details of what constitutes a valid permalink as a result of those two issues are:
A permalink can contain any of the following items:
:slug
:id
:year
:month
:day
:author
- santised custom text containing a-z, 0-9, - or _
To be a valid permalink:
- each item must be separated by a ‘/’,
- there should be a maximum of 5 items
- one of them must be
:slug
or:id
so that the post can be identified. - no url part can be
ghost
Examples
I could set my blog posts to have a URL like any of these:
/:year/:month/:slug/
/:year/:slug/
/blogpost/:id/
/post/:year/:month/:day/:slug/
/:author/:slug/
- And many more combinations
Please note that contrary to what is shown in the new UI, Ghost does not yet support having a tag in your permalink, because at present we have no way to indicate which tag would be the canonical one.
Issue Analytics
- State:
- Created 10 years ago
- Comments:21 (15 by maintainers)
Top GitHub Comments
@Cellane There is a table called
settings
.This query makes it possible to change the location of all posts.
But note: We are about to ship the beta of dynamic routing. This feature makes it possible to configure your routes in a yaml routing file. I would recommend waiting for the upcoming release next week.
I asked this question on slack however didn’t get a response so thought I’d shoot a question on here. Is there any plans of implementing this for 1.0/x or a general overhaul of the whole permalink structure so you can do things like sub pages or put all posts under
/post
for example?