Skip to content

What is the best aproach of including meta tags only in blog-post pages? #7701

Answered by kamilkrzyskow
Andre601 asked this question in Q&A
Discussion options

You must be logged in to vote

If that's the only thing you're changing in the blog-post.html, you could just forgo the file override and just override the site_meta block inside your main.html. You should be able too access variables like {{ page.__class__.__module__ }} or {{ page.__class__.__name__ }} to detect what is the Page's class, and then you'd use it in a conditional to limit the changes accordingly.

Or without Python shenanigans, just access the page.meta.template to find out what the template name is and check if it's blog-post.html 😅

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@kamilkrzyskow
Comment options

Answer selected by Andre601
@Andre601
Comment options

@Andre601
Comment options

@Andre601
Comment options

@kamilkrzyskow
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants