-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
[Feature] Permalink Settings UI #1631
Comments
Custom permalinks from the UI would be smashing. I'm not a js dev but managed to fudge it so the blog is served from: but pages have a custom path e.g. It would be great to have this in the UI. |
Once UI ^ is done, this issue can be used for the back end implementation. Assigning back to @jgillich |
Heyo, where are we at with this? It seems all referenced issues in the original issue description have been closed. and #4217 added a mockup for the UI. It now just needs to be added to the general settings page, and hooked into the api? (is there an api endpoint for it?) |
I've updated this issue to outline the work that needs to be done - there are 2 further issues which I think need raising, so I'll put those up in due course once #4454 has been closed ;) |
I've now raised two further issues for this, which I believe should cover the implementation of the feature. |
Why not allow arbitrary separators (or no separators)? For instance:
If arbitrary separators cannot be done, and I have post URLs following
Personally I like the idea of option 2, or at least arbitrary separators. |
Are literal segments going to be supported (for instance Also, why limit to five segments? That sounds like an arbitrary decision, which might hint at a code smell. |
Agree, that should be possible
Is absolutely what's going to happen if someone visits a random URL. The alternative would be a nightmare in many, many ways.
Yes, that should be possible
I agree it shouldn't be limited to 5, cc @ErisDS NB: Keep in mind all of this is simply a default set of dynamic permalinks. You can enter whatever the hell you want into the database, which in future will be possible via an App UI. |
Slug has
Again, unless we start from the beginning, and count. Is the first segment |
Hi @ravinggenius what you refer to as a literal segment, I called 'santised custom text' :) As for arbitrary separators, in my opinion this adds unnecessary complexity at this stage. It would require the UI that has been designed and built to be redesigned, as well as adding complexities to processing URLs as @javorszky has explained. I believe we should aim for the existing spec, and if arbitrary separators is something required by enough people then it can be added later. |
Makes total sense RE separators. Agreed. |
It is a somewhat arbitrary decision, intended to limit the complexity of URLs that users design. Currently there are only 5 possible sections according to the validation in the codebase (id, day, month, year, slug and id), and having any one of them twice would be odd. Issue #4486 aims to update this validation, and it can also remove the restriction to 5 items if it is felt strongly that it should be possible to build longer URL structures. |
Thanks for the clarification.
In my opinion we shouldn't be manually splitting strings to parse out segments. A while ago I wrote some code (test) to transform a pattern like [1] The GUI could instead generate patterns like [2] If you don't know, Ruby can optionally name capture groups. For instance |
@ravinggenius It is not a good idea to introduce further complexity at this stage. We need to implement a base-level version of this, just to get it off the ground and into the code base - this is a relatively old issue, and it's not being worked on at present. Therefore we're far more likely to simplify the problem to make it easier to pick up and work on. Once we've got a basic version in, by all means the community can extend it to do more - but right now there's very little point talking about a more advanced version when it doesn't exist at all ;) Perhaps you'd like to pick up #4486 to ensure it's done in a way that is easily extensible in future? |
Short term, custom permalinks are working well if you configure them via the database. Long term we'll revisit adding the UI to settings again, or via some other method when it becomes more of a priority issue. |
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 |
@jloh sorry for the slow reply. This issue represents the idea of adding a UI for the existing permalink settings. Adding this would not result in the ability to sub pages. It is already possible to put all posts under |
@ErisDS Apologies for asking a partially unrelated question in the issue but I think this thread is the most related discussion to an issue I have right now. I’m thinking of migrating my site from Jekyll to Ghost and putting all posts under |
@Cellane There is a table called
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. |
@kirrg001 I see, thank you very much for this information! With that new piece of information in mind, I think I’ll spend the weekend doing the actual article migration (while avoiding modifying the |
The 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:
Permalinks UI #3920Mockup herePermalink UI Revisited #4454Return a computedurl
field with the post object #4445Ghost Permalink Spec
The details of what permalink formats we support were originally covered by #2057 and extended by #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
To be a valid permalink:
:slug
or:id
so that the post can be identified.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/
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.
The text was updated successfully, but these errors were encountered: