Skip to content

Commit a0da134

Browse files
committed
Listings for blog posts tags: releases and news
1 parent 8de8060 commit a0da134

File tree

9 files changed

+87
-3
lines changed

9 files changed

+87
-3
lines changed

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
source "https://rubygems.org"
22

33
gem "bulma-clean-theme"
4+
gem "jekyll-paginate-v2"

Gemfile.lock

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ GEM
3737
jekyll-feed (0.15.1)
3838
jekyll (>= 3.7, < 5.0)
3939
jekyll-paginate (1.1.0)
40+
jekyll-paginate-v2 (3.0.0)
41+
jekyll (>= 3.0, < 5.0)
4042
jekyll-sass-converter (1.5.2)
4143
sass (~> 3.4)
4244
jekyll-seo-tag (2.7.1)
@@ -74,6 +76,7 @@ PLATFORMS
7476

7577
DEPENDENCIES
7678
bulma-clean-theme
79+
jekyll-paginate-v2
7780

7881
BUNDLED WITH
7982
2.2.5

_config.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
theme: bulma-clean-theme
22
title: Shutter - Screenshot Tool
33
description: Shutter - Screenshot Tool website
4-
paginate: 5
5-
paginate_path: "/blog/page:num"
64
permalink: pretty
75
footer_menu: footer_menu
86

@@ -26,3 +24,25 @@ defaults:
2624

2725
plugins:
2826
- jekyll-feed
27+
- jekyll-paginate-v2
28+
29+
autopages:
30+
enabled: true
31+
categories:
32+
enabled: false
33+
collections:
34+
enabled: false
35+
tags:
36+
layouts:
37+
- autopage_tags.html
38+
enabled: true
39+
40+
pagination:
41+
enabled: true
42+
per_page: 10
43+
permalink: '/page:num/'
44+
sort_field: 'date'
45+
sort_reverse: true
46+
trail:
47+
before: 5
48+
after: 5

_data/navigation.yml

+5
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@
3030
link: /contact/
3131
- name: Blog
3232
link: /blog/
33+
dropdown:
34+
- name: Releases
35+
link: /tag/release/
36+
- name: News
37+
link: /tag/news/
3338
- name: <i class="fas fa-rss-square"></i>
3439
link: /feed.xml

_includes/pagination.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!-- replaced page loop with one compatible with jekyll-paginate-v2 -->
2+
<nav class="pagination is-centered">
3+
{% if paginator.previous_page %}
4+
<a href="{{ site.baseurl }}{{ paginator.previous_page_path }}" class="pagination-previous is-info">Previous</a>
5+
{% else %}
6+
<p class="pagination-previous" disabled>Previous</p>
7+
{% endif %}
8+
{% if paginator.next_page %}
9+
<a href="{{ site.baseurl }}{{ paginator.next_page_path }}" class="pagination-next is-info">Next</a>
10+
{% else %}
11+
<p class="pagination-next" disabled >Next</p>
12+
{% endif %}
13+
<ul class="pagination-list">
14+
{% for trail in paginator.page_trail %}
15+
{% if page.url == trail.path %}
16+
<li><a class="pagination-link is-current">{{ trail.num }}</a></li>
17+
{% else %}
18+
<li><a href="{{ trail.path | prepend: site.baseurl | remove: "index.html" }}" class="pagination-link">{{ trail.num }}</a></li>
19+
{% endif %}
20+
{% endfor %}
21+
</ul>
22+
</nav>

_includes/tag.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a class="tag is-primary" href="{{ site.baseurl }}/tag/{{ tag }}/">{{ tag }}</a>

_layouts/autopage_tags.html

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: default
3+
---
4+
5+
<!-- verbatim copy of theme's blog.html due to https://github.com/sverrirs/jekyll-paginate-v2/issues/88 -->
6+
<div class="columns is-multiline">
7+
<div class="column is-12">
8+
{% include pagination.html %}
9+
</div>
10+
{% for post in paginator.posts %}
11+
<div class="column is-12">
12+
{% include post-card.html %}
13+
</div>
14+
{% endfor %}
15+
<div class="column is-12">
16+
{% include pagination.html %}
17+
</div>
18+
<div class="column is-12">
19+
{% include subscribe.html %}
20+
</div>
21+
</div>

blog/index.html

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
22
layout: blog
33
title: Blog
4+
pagination:
5+
enabled: true
46
---

netlify.toml

+10-1
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,20 @@
4040
from = "/preview/*"
4141
to = "/screenshots"
4242

43+
[[redirects]]
44+
from = "/category/news"
45+
to = "/tag/news"
46+
[[redirects]]
47+
from = "/category/release"
48+
to = "/tag/release"
49+
[[redirects]]
50+
from = "/category/*"
51+
to = "/blog"
52+
4353
[[redirects]]
4454
from = "/2018/09/quick-bug-fix-in-0-94-2"
4555
to = "/releases/0.94.2"
4656
force = true
47-
4857
[[redirects]]
4958
from = "/2018/09/new-bug-fix-release-0-94-1"
5059
to = "/releases/0.94.1"

0 commit comments

Comments
 (0)