Skip to content

Commit 7548a1f

Browse files
committed
Implement optional jekyll-tagging
1 parent 9379c31 commit 7548a1f

File tree

10 files changed

+33
-37
lines changed

10 files changed

+33
-37
lines changed

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
source "https://rubygems.org"
2+
3+
gem "liquid-md5"
4+
gem "jekyll-tagging"
5+
26
gemspec

_config.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ description: > # this means to ignore newlines until "show_exerpts:"
77
Google search results) and in your feed.xml site description.
88
show_excerpts: false # set to true to show excerpts on the homepage
99

10-
paginate: 5
10+
tag_permalink_style: pretty
11+
12+
paginate: 2
1113
paginate_path: "/blog/page:num/"
1214

15+
tag_page_layout: tag_page
16+
tag_page_dir: tag
17+
1318
# jekyll-dash date format
1419
# refer to http://shopify.github.io/liquid/filters/date/ if you want to customize this
1520
dash:
@@ -39,3 +44,4 @@ plugins:
3944
- jekyll-seo-tag
4045
- jekyll-paginate
4146
- liquid-md5
47+
- jekyll/tagging

_includes/author.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<div class="author-box">
2+
{% if site.plugins contains "liquid-md5" %}
23
<img src="https://gravatar.com/avatar/{{ site.email | downcase | md5 }}?s=72" class="author-avatar" />
4+
{% endif %}
35
{{ site.description }}
46
</div>

_includes/tagcloud.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
{% if site.plugins contains "jekyll/tagging" %}
3+
<h2>All tags</h2>
4+
<div class="tag-cloud">
5+
{{ site | tag_cloud }}
6+
</div>
7+
{% endif %}

_layouts/home.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ <h1>Recent blog articles</h1>
1111
<a href="{{ post.url | relative_url }}" class="post-link">{{ post.title }}</a>
1212
<div class="post-meta">
1313

14+
{% if site.plugins contains "jekyll/tagging" %}
1415
<div class="post-tags">
1516
{% for tag in post.tags %}
1617
<a class="tag" href="/tag/{{ tag }}/">{{ tag }}</a>
1718
{% endfor %}
1819
</div>
20+
{% endif %}
1921
{% if site.date_format %}
2022
{{ post.date | date: site.date_format }}
2123
{% else %}
@@ -27,6 +29,8 @@ <h1>Recent blog articles</h1>
2729
</div>
2830

2931
{% include pagination.html %}
32+
33+
{% include tagcloud.html %}
3034
{% else %}
3135
<div>No posts yet.</div>
3236
{% endif %}

_layouts/post.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
{% include author.html %}
55
<div class="post">
66
<h1 class="post-title">{{ page.title }}</h1>
7+
{% if site.plugins contains "jekyll/tagging" %}
78
<div class="post-tags">
89
{% for tag in page.tags %}
910
<a class="tag" href="/tag/{{ tag }}/">{{ tag }}</a>
1011
{% endfor %}
1112
</div>
13+
{% endif %}
1214
<div class="post-date">Published on {{ page.date | date_to_string }}</div>
1315
{% if page.description != null %}
1416
<div class="post-description"><span class="color-blue">> </span>{{ page.description }}</div>

_layouts/tag_index.html renamed to _layouts/tag_page.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
---
44
{% include author.html %}
5-
<h1 class="post-title">Articles tagged with <a class="tag" href="/tag/{{ tag }}/">{{ page.tag }}</a></h1>
5+
<h1 class="post-title">Articles tagged with <a class="tag" href="/tag/{{ page.tag }}/">{{ page.tag }}</a></h1>
66
<div class="post-links">
77
{% for post in site.posts %}
88
{% for tag in post.tags %}
@@ -31,3 +31,4 @@ <h1 class="post-title">Articles tagged with <a class="tag" href="/tag/{{ tag }}/
3131
{% endfor %}
3232

3333
</div>
34+
{% include tagcloud.html %}

_plugins/_tag_gen.rb

Lines changed: 0 additions & 33 deletions
This file was deleted.

_sass/dash/_layout.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@
101101
}
102102
}
103103

104-
.tag {
104+
.tag-cloud {
105+
margin-bottom: 2em;
106+
}
107+
108+
.tag, .tag-cloud > a {
105109
color: $color-green;
106110
background-color: $color-background-dark;
107111
padding: 0.3em 0.6em;

jekyll-dash.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Gem::Specification.new do |spec|
1616
spec.add_runtime_dependency "jekyll-feed", "~> 0.9"
1717
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1"
1818
spec.add_runtime_dependency "jekyll-paginate"
19-
spec.add_runtime_dependency "liquid-md5", "~> 0.0.3"
2019

2120
spec.add_development_dependency "bundler", "~> 2.0.1"
2221
spec.add_development_dependency "rake", "~> 12.0"

0 commit comments

Comments
 (0)