Custom post.hbs


#1

is it possible to create a single post template for styling a specific tag?


#2

styling a specific tag

Yep:

create a file called tag-{slug}.hbs and that will take precedence


#3

Sorry, I’m confused. Isn’t that the tag listing page?
What I’m trying to do is have a separate single post page for a particular tag.

Say if I have a tag called quotes, and I click into the single post view. I want it to display only the content of the post, not the title or the meta data.

I know you can do post{slug}.hbs on a post by post basis, but I want to do it on a tag tag basis. Something like post{tag}.hbs


#4

I don’t follow on what you’re trying to do?

Go to /tag/quotes -> It displays only post content rather than post meta for every post?


#5

I think that @MayanMisfit wants something like this. All posts that have a certain tag to automatically get a post template. For example:

collections:
  /news/:
    permalink: /news/{slug}/
    filter: news
    template: news

The template for /news/ is news.hbs. But all posts will get post.hbs as template. So he wants to get post-news.hbs for all these posts.

Not sure there is a way to set but I might be wrong. I can only think of using {{#has tag="news"}} inside post.hbs and load from partials a custom structure.


#6

Yes, that’s pretty much it. Could I put like 95% of the post.hbs in to a partial? Well all the styled elements at least? So I’d have a partial called ‘posts’ and one called ‘notes’


#7

Ok this is sorted now, I was being dense