Skip to content

Commit

Permalink
Added categories page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Because789 committed Nov 13, 2023
1 parent bde8189 commit 1105d68
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
9 changes: 5 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ baseurl: "" # place folder name if the site is served i

title: "A blog by Because789"
description: "Random thoughts of a confused mind."
author:
name: "Because789"
email: "[email protected]"
# author:
# name: "Because789"
# email: "[email protected]"

exclude: ['README.md']

Expand All @@ -15,7 +15,8 @@ minima:
skin: dark
date_format: "%d. %b %Y"
header_pages:
- static/about.md
- categories.md
- about.md
# Generate social links in footer:
social_links:
- { platform: github, user_url: "https://github.com/Because789" }
Expand Down
3 changes: 1 addition & 2 deletions _posts/2023-11-13-test.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
layout: post
title: "Test"
categories: test
tags: ["test"]
categories: Test
# published: false
---

Expand Down
12 changes: 12 additions & 0 deletions _posts/2023-11-13-test1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: post
title: "Test 1"
categories: [Test, Whatever]
# published: false
---

# My second post

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

I hope you like it!
23 changes: 23 additions & 0 deletions categories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: page
permalink: /categories/
title: Categories
---

<div id="archives">
{% for category in site.categories %}
<div class="archive-group">
{% capture category_name %}{{ category | first }}{% endcapture %}
<div id="#{{ category_name | slugize }}"></div>
<p></p>

<h3 class="category-head">{{ category_name }}</h3>
<a name="{{ category_name | slugize }}"></a>
{% for post in site.categories[category_name] %}
<article class="archive-item">
<h4><a href="{{ site.baseurl }}{{ post.url }}">{{post.title}}</a></h4>
</article>
{% endfor %}
</div>
{% endfor %}
</div>

0 comments on commit 1105d68

Please sign in to comment.