jekyll / minima

Minima is a one-size-fits-all Jekyll theme for writers.
https://jekyll.github.io/minima/
MIT License
3.43k stars 3.62k forks source link

[SOLVED] How to change post-header? #683

Closed Hyrtsi closed 2 years ago

Hyrtsi commented 2 years ago

Greetings. Minima has the post header like this:

<header class="post-header">
    <h1 class="post-title p-name" itemprop="name headline">Bicycling around the world</h1>
    <p class="post-meta"><time class="dt-published" datetime="2022-10-09T14:37:11+03:00" itemprop="datePublished">
        Oct 9, 2022
      </time></p>
  </header>

I would like to add the tags of the post there so it would look something like this:

Bicycling around the world

Oct 9, 2022 Tags: bicycling, travelling

How do I do that? I have tried the following:

Thank you.

Hyrtsi commented 2 years ago

Edit: SOLVED!

Answer:

In my case, I'm adding

    <p class="post-meta">
        {% if page.tags.size > 0 %}
        Tag{% if page.tags.size > 1 %}s{% endif %}:
        {{ page.tags | sort | join: ", " }}
        {% endif %}
    </p>

before </header>