Reputation: 1712
I have a Jekyll website with a number of static pages and a number of blog posts.
On the static pages, my page title is "Site-wide Title | Page Title", which is okay. But on blog posts, I would like the page title to be only the post title, without my site-wide title in front.
The <title>
tag is defined in my _includes/head.html, and says
{% if page.title %}My website | {{ page.title }}{% else %}{{ site.title }}{% endif %}
site.title
? I can't find it in the Jekyll docsUpvotes: 3
Views: 897
Reputation: 12592
Use this condition in your head.html:
{% if page.layout == 'post' %}
{{ page.title }}
{% else %}
{{ site.title }} | {{ page.title }}
{% endif %}
However, I would recommend to put the 'page.title' in front of the 'site.title'.
Upvotes: 3