New URL helper - URL consistency fixes#1817
Merged
ErisDS merged 1 commit intoTryGhost:masterfrom Jan 6, 2014
Merged
Conversation
core/server/config/paths.js
Outdated
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Member
Author
|
Yeah, I'm not happy with the urlFor function. Currently it is what the We need something more like what is described in #1833, but there are challenges. Right now urlFor is focused on generating urls for posts... but maybe that should be more explicit |
core/server/config/paths.js
Outdated
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
fixes TryGhost#1765 fixes TryGhost#1811 issue TryGhost#1833 New UrlFor functions - moved body of url helper to config.path.urlFor, which can generate a URL for various scenarios - urlFor can take a string (name) or object (relativeUrl: '/') as the first argument - this is the first step towards issue TryGhost#1833 - also added config.path.urlForPost which is async and handles getting permalink setting - frontend controller, ghost_head helper, cache invalidation all now use urlFor or urlForPost all urls should be correct and consistent URL Consistency Improvements - refactored invalidateCache into cacheInvalidationHeader which returns a promise so that url can be generated properly by urlForPost - moved isPost from models to schema, and refactored schema to have a tables object - deleted posts now return the whole object, not just id and slug, ensuring cache invalidation header can be set on delete - frontend controller rss and archive page redirects work properly with subdirectory - removes {{url}} helper from admin and client, and replaced with adminUrl helper which also uses urlFor - in res.locals ghostRoot becomes relativeUrl, and path is removed
ErisDS
added a commit
that referenced
this pull request
Jan 6, 2014
New URL helper - URL consistency fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #1765
fixes #1811
issue #1833
New UrlFor functions
argument - this is the first step towards issue Improve URL generation across the app #1833
permalink setting
urlFor or urlForPost all urls should be correct and consistent
URL Consistency Improvements
promise so that url can be generated properly by urlForPost
ensuring cache invalidation header can be set on delete
helper which also uses urlFor