Skip to content

Commit

Permalink
Show categories in the posts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Because789 committed Nov 13, 2023
1 parent 2a8f2b4 commit 1d546c9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ minima:
skin: dark
date_format: "%d. %b %Y"
header_pages:
- categories.md
- about.md
- categories.md
# Generate social links in footer:
social_links:
- { platform: github, user_url: "https://github.com/Because789" }
Expand Down
12 changes: 12 additions & 0 deletions _posts/2023-11-13-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ categories: Test
# published: false
---

<div class="post-categories">
{% if post %}
{% assign categories = post.categories %}
{% else %}
{% assign categories = page.categories %}
{% endif %}
{% for category in categories %}
<a href="{{site.baseurl}}/categories/#{{category|slugize}}">{{category}}</a>
{% unless forloop.last %}&nbsp;{% endunless %}
{% endfor %}
</div>

# Welcome

**Hello world**, this is my first Jekyll blog post.
Expand Down
12 changes: 12 additions & 0 deletions _posts/2023-11-13-test1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ categories: [Test, Whatever]
# published: false
---

<div class="post-categories">
{% if post %}
{% assign categories = post.categories %}
{% else %}
{% assign categories = page.categories %}
{% endif %}
{% for category in categories %}
<a href="{{site.baseurl}}/categories/#{{category|slugize}}">{{category}}</a>
{% unless forloop.last %}&nbsp;{% endunless %}
{% endfor %}
</div>

# My second post

**Hello world**, this is my first Jekyll blog post.
Expand Down

0 comments on commit 1d546c9

Please sign in to comment.