This article introduces how to modify Jekyll article titles to “Page Title - Site Title”.
Jekyll seems to adopt a template engine called Liquid instead of ERB. Liquid syntax is unique, so it’s a bit difficult to get used to, but the functionality itself is minimal, so there’s not much to memorize.
Jekyll’s default article title is “Page Title”, but we’ll change it to the WordPress-like “Page Title - Site Title” style.
Edit _includes/head.html.
<title><br />
{% if page.title %}<br />
{% capture new_title %}{{ page.title }} - {{ site.title }}{% endcapture %}<br />
{{ new_title }}<br />
{% else %}<br />
{{ site.title }}<br />
{% endif %}<br />
</title>
Inline version
<title>{% if page.title %}{% capture new_title %}{{ page.title }} << YAYB {% endcapture %}{{ new_title }}{% else %}{{ site.title }}{% endif %}</title>