-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
✨New helper: content_api_url #21331
✨New helper: content_api_url #21331
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor comments but otherwise it looks good!
} | ||
} | ||
|
||
module.exports.async = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be an async helper! It will be much more performant without it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're also missing a newline at the bottom of this file - I would recommend installing an EditorConfig plugin for your editor
refs TryGhost/Ghost#21331 We need to make sure that theme developers are able to use the new helpers without gscan errors!
This adds a `content_api_url` helper, returning the url for Ghost's Content API. By default it will return an absolute URL but can be passed `absolute=false` if a relative URL is wanted. This works in tandem with the `content_api_key` helper to facilitate third party integrations with the Content API, for example - custom Portal or Search implementations.
This adds a content_api_url helper, returning the url for Ghost's content api. Takes a false argument if a relative URL is wanted.
Why? Because I just realized I don't have access to the content API's url in handlebars. :) This addition will facilitate 3rd party integrations built into themes.
Companion PR for gscan: TryGhost/gscan#558