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

Theme API: {{url}} handlebars helper #528

Closed
ErisDS opened this issue Aug 25, 2013 · 1 comment · Fixed by #541
Closed

Theme API: {{url}} handlebars helper #528

ErisDS opened this issue Aug 25, 2013 · 1 comment · Fixed by #541
Assignees
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Aug 25, 2013

When in the context of a post, this helper should output '/' + slug.

Users will soon also have slugs, and so will tags, but none of this is available yet. Therefore the helper should check that it is definitely in a post context and only output if it is. Once we get tag pages and user pages we can add those URLs in.

@ErisDS
Copy link
Member Author

ErisDS commented Aug 25, 2013

Not sure what the best way to determine if the context is a post is.

I'm thinking of having a set of methods in models/index.js such as:

isPost(jsonData) which return true if the json object has a certain set of properties, such as content & content raw for posts.

Any better ideas?

@ghost ghost assigned cobbspur Aug 25, 2013
cobbspur added a commit to cobbspur/Ghost that referenced this issue Aug 26, 2013
closes TryGhost#528

- adds method (isPost)to models index.js that returns true if content, content_raw, title and slug are valid properties
- adds url helper which checks context is post using  isPost method
- adds unit test to check a url is prefixed with  /
-adds unit test which checks for empty string if either of the 4 properties above are not present.
@JohnONolan JohnONolan mentioned this issue Aug 27, 2013
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants