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

Support for additional permalink structures #2057

Closed
ErisDS opened this issue Jan 28, 2014 · 0 comments · Fixed by #2116
Closed

Support for additional permalink structures #2057

ErisDS opened this issue Jan 28, 2014 · 0 comments · Fixed by #2116
Assignees
Labels
affects:import/upgrade life-cycle stuff: Importing, exporting, upgrading and migrating
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Jan 28, 2014

Currently, Ghost supports the following permalink structures:

  • Standard: /:slug/
  • Dated: /:year/:month/:day/:slug/

In order to make it easier for people to move their blogs from other platforms to Ghost, we want to support any permalink structure which contains any of the following items:

  • :slug
  • :id
  • :year
  • :month
  • :day
  • santised custom text containing a-z, 0-9, - or _

To be a valid permalink, each item must be separated by a '/', and there should be a maximum of 5 items. the permalink must contain one of :slug or :id so that the post can be identified.

So 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/

At the completion of this issue, Ghost should support these structures if the permalink setting is modified directly in the DB. The UI for configuring the permalink in admin is covered by issue #1631.

Note:

Some things we should consider for the future are:

  • whether or not to support adding .html to the end of URLs so that imports from blogger work,
  • whether to import custom data and allow that in the URL, like the id which is in tumblr URLs

We do want to make it possible to have an app that does mass re-writing/redirecting of URLs... so we could solve these problems by having an app 301 redirect the .html out of blogger urls, and the id out of tumblr urls, in which case blogger becomes /:year/:month/:slug/ and blogger becomes /post/:slug/or even the default /:slug/.

@ghost ghost assigned hswolff Feb 1, 2014
hswolff added a commit to hswolff/Ghost that referenced this issue Feb 10, 2014
fixes TryGhost#2057

- uses express’ Route object to create RegExp’s
 that we use to check the incoming path
- refactored structure of fronted controller single
 tests to be easier to read
- amend regex to incorporate new allowed permalink
 structure
@ErisDS ErisDS modified the milestones: 0.4.2, 0.5 Mar 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:import/upgrade life-cycle stuff: Importing, exporting, upgrading and migrating
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants