-
-
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
[Feature] Tag pages #2111
Comments
I'd love to tackle this. I really want it in my blog so that passion will drive my work. =D |
Addendum to this: If would be very good if the
NB: I don't fully understand all of the nuances around dynamically adding/removing reserved routes - so - if this is outside the scope of 0.5, it can wait. |
I usually lurk on the effort of the developers, but this time I'd like to put some ideas on the table. Be ready to deal with:
Thanks for your brave work! |
Great examples to use for tests. Thanks @mpancorbo! |
Wow, this is actually the one feature I really miss from the 0.4.x releases. I started using tags, but the sad gray words definitely need hyperlinks to those tag pages! 👍 for @hswolff |
fixes TryGhost#2111 - modified Post model to support a tag query param that will filter the desired post collection to only include posts that contain the requested tag - in the updated Post model it includes the Tag model under a nested object called 'aspects' - added tests for updated Post model, updating test utils to add more posts_tags relations - adds two new routes to frontend, one for initial tag page, another to page that tag page - for tag pages the array of posts is exposed to the view similarly to the homepeage - on the tag view page the information for the tag is also accessible for further theme usage - the tag view page supports a hierarchy of views, it'll first attempt to use a tag.hbs file if it exists, otherwise fall back to the default index.hbs file - modified pageUrl and pagination helper to have it be compatible with tag paging - added unit tests for frontend controller - added unit tests for handlebar helper modifications - add functional tests for new tag routes
Nice feature! Looking forward for it! |
Adding a few thoughts here. I know eventually magazine style layout support is expected. When that happens and a tag farm is broken into navigation tags, search tags, nested tags and related tags, I hope it is prudent to put in a tag URL builder of sorts which allows a "site.com/tag/world" become "site.com/world". From a webmaster's structure perspective, if microformat support is to be brought in, then this would be valuable to SEO. Thank you so much for Ghost. It's rekindled my passion for writing code. |
Tag pages allow the for the browsing of posts which have a particular tag, by visiting the route:
Where
:slug
is the slug of a particular tag.The tag page will provide the template with a paginated set of posts for the given tag, which can be accessed via
{{#foreach posts}}
in exactly the same way as the standard post list is rendered usingindex.hbs
.Additionally, tag pages will provide the template with all the data for the given tag such that it can be accessed by the tag via
{{#tag}}
in the same style as thepost.hbs
template.The new tag controller will support a template/view hierarchy much like
page.hbs
>post.hbs
. If there is a template calledtag.hbs
this will be used to render the page, otherwise tag pages will use the standardindex.hbs
which lists out posts.Note: for this to be truly useful, there are some changes need to some of our handlebars helpers as covered by #2112
Note: for users to really love this feature, they're going to need to be able to manage their tags - delete unused ones, edit descriptions, etc. This will come along in #2119
The text was updated successfully, but these errors were encountered: