Skip to content

Commit d039349

Browse files
committed
tagging
1 parent 282be83 commit d039349

File tree

7 files changed

+37
-7
lines changed

7 files changed

+37
-7
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ source "https://rubygems.org"
1414
gem "github-pages", group: :jekyll_plugins
1515
# If you have any plugins, put them here!
1616
group :jekyll_plugins do
17-
gem "jekyll-feed", "~> 0.12"
17+
gem "jekyll-tagging"
1818
end
1919

2020
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem

_config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ social_links:
1212
- { platform: github, user_url: "https://github.com/libewa" }
1313
- { platform: codeberg, user_url: "https://twitter.com/libewa" }
1414

15+
tag_page_layout: tag
16+
tag_page_dir: tag
17+
1518
# Build settings
1619
plugins:
1720
- jekyll-feed
18-
- jekyll-remote-theme
1921
- jemoji
2022
- jekyll-default-layout
23+
- jekyll-tagging
2124
- jekyll-sitemap

_includes/sidebar.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<div id="sidebar-left" class="sidebar glass container" >
22
<nav id="sidenav">
33
{%- include navlinks.html -%}
4-
<h3>Recent Posts</h3>
5-
<ul id="sidebar-post-list">
6-
{% for post in site.posts limit:5 %}
7-
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
8-
{% endfor %}
4+
<h3>Tags</h3>
5+
<ul id="sidebar-tag-list">
6+
{%- include taglist.html -%}
97
</ul>
108
</nav>
119
<nav id="topnav">

_includes/taglist.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- for tag in site.tags -%}
2+
<li><a href="{{ '/tag/' | append: tag[0] | relative_url }}">{{ tag[0] }}</a></li>
3+
{%- endfor -%}

_layouts/home.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
{{ content }}
77

88

9+
<h1 class="post-list-heading">All posts</h1>
10+
911
{% if site.paginate %}
1012
{% assign posts = paginator.posts %}
1113
{% else %}

_layouts/tag.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: base
3+
---
4+
<h1 class="post-list-heading">Posts tagged with "{{ page.tag }}"</h1>
5+
<ul class="post-list">
6+
{%- assign date_format = site.minima.date_format | default: "%b %-d, %Y" -%}
7+
{%- for post in site.tags[page.tag] -%}
8+
<li>
9+
<span class="post-meta">{{ post.date | date: date_format }}</span>
10+
<h3>
11+
<a class="post-link" href="{{ post.url | relative_url }}">
12+
{{ post.title | escape }}
13+
</a>
14+
</h3>
15+
{%- if site.show_excerpts -%}
16+
{{ post.excerpt }}
17+
{%- endif -%}
18+
</li>
19+
{%- endfor -%}
20+
</ul>

assets/css/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ h1 {
6363
font-family: $code-font-family, monospace;
6464
}
6565

66+
.post-list-heading {
67+
font-size: 26px;
68+
}
69+
6670
h1 a {
6771
color: $light-color;
6872
text-decoration: none;

0 commit comments

Comments
 (0)