2
votes

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 %}

  1. How do I set up different formats for pages and posts?
  2. What is site.title? I can't find it in the Jekyll docs
1
What theme are you using?marcanuy
@marcanuy: Ehm, I'm not sure. I know I'm using bootstrap. And then, probably the default theme. I edited my post with a bit more details, if that helps.Alexander Engelhardt

1 Answers

2
votes

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'.