Skip to content
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

When date permalink is ticked, links to post do not work #1757

Closed
simonech opened this issue Dec 25, 2013 · 6 comments · Fixed by #1793
Closed

When date permalink is ticked, links to post do not work #1757

simonech opened this issue Dec 25, 2013 · 6 comments · Fixed by #1793
Labels
bug [triage] something behaving unexpectedly
Milestone

Comments

@simonech
Copy link

I just changed my permalink structure to include the date but looks like it's not working: links in the homepage have the right formate yyyy/mm/dd/title but when clicking on them I get a 404 page.
This happens both with posts published before and after the change in the permalink format.

If you want to test:
http://codeclimber-ghost.azurewebsites.net/

@halfdan
Copy link
Contributor

halfdan commented Dec 25, 2013

You'll have to restart Ghost.

@simonech
Copy link
Author

Mmm... I'd add a note next to the option then, something like:
The options in this area need you to restart Ghost
(I think also changing themes requires a restart)

@ErisDS
Copy link
Member

ErisDS commented Dec 26, 2013

Hi @simonech, thanks for reporting this. You should not have to restart Ghost, so it seems you've found a bug.

@hswolff
Copy link
Contributor

hswolff commented Dec 26, 2013

FYI I started work on fixing this last night. Should have something to show soon.

hswolff added a commit to hswolff/Ghost that referenced this issue Dec 30, 2013
closes TryGhost#1757 and TryGhost#1773

- switches routes.frontend for posts and pages
to use a regex with two capturing groups.  This removes
the need to dynamically remove an express route at a
later point, leaving the decision making to frontend
controller.

- added unit tests for all routing conditions that 
can arise for posts and pages.

- updated functional tests to also test for same thing
in unit tests

- removes old code from server/api/index that used
to fix this issue, but is no longer needed

- removed some un-needed require statements in routes/admin
@jgillich
Copy link
Contributor

I know I'm a bit late, but why was it necessary to replace the dynamic permalink route with a regex that only allows the two current formats?

We want to allow pretty much any format, so when #1631 is done I would have to revert this (?)

@hswolff
Copy link
Contributor

hswolff commented Jan 18, 2014

There were a number of bugs with that version of the code, from what I recall the two most prominent were:

  1. A static page post could also be accessed in the date format when that was the desired slug format.
  2. The permalink structure's weren't correctly updating when they were saved in the admin. It wouldn't activate the new permalink structure and maintain the old one, or something along those lines.

I took this approach to fixing it, I'm sure there were other alternatives.

Ultimately longer term we will definitely be supporting any combination of custom permalinks. In this thread I made a suggestion of how we could go about doing that.

But because it's a wider touching solution we went with this direction to help get 0.4 out the door.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants