Skip to content

Commit

Permalink
use paginator v2 to generate category pages
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusIO committed Jun 30, 2024
1 parent e307a31 commit b9fcd83
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 28 deletions.
30 changes: 14 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
autoprefixer-rails (9.8.6.5)
execjs
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.3)
domain_name (0.6.20240107)
down (5.4.2)
addressable (~> 2.8)
Expand All @@ -16,15 +17,14 @@ GEM
eventmachine (1.2.7)
execjs (2.7.0)
fastimage (2.3.1)
ffi (1.16.3)
ffi (1.17.0-arm64-darwin)
fileutils (1.7.2)
forwardable-extended (2.6.0)
google-protobuf (4.26.1-arm64-darwin)
rake (>= 13)
google-protobuf (4.26.1-x86_64-linux)
google-protobuf (4.27.1-arm64-darwin)
bigdecimal
rake (>= 13)
http-accept (1.7.0)
http-cookie (1.0.5)
http-cookie (1.0.6)
domain_name (~> 0.5)
http_parser.rb (0.8.0)
i18n (1.14.5)
Expand Down Expand Up @@ -72,11 +72,11 @@ GEM
mercenary (0.4.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0507)
mime-types-data (3.2024.0604)
netrc (0.11.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.5)
public_suffix (6.0.0)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
Expand All @@ -86,14 +86,13 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.3.1)
strscan
rickshaw (0.5.0)
rouge (4.2.1)
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.77.2)
sass-embedded (1.77.5-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13.0.0)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand All @@ -102,7 +101,6 @@ GEM

PLATFORMS
arm64-darwin-23
x86_64-linux

DEPENDENCIES
down
Expand Down
20 changes: 12 additions & 8 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,18 @@ pagination:
sort_field: 'date'
sort_reverse: true

jekyll-archives:
enabled:
- categories
layouts:
category: archive-category
permalinks:
category: '/kategorie/:name/'
autopages:
enabled: true

categories:
layouts:
- 'autopage_category.html'
title: 'Artikel in #:cat'
permalink: '/kategorie/:cat'
silent: false
slugify:
mode: 'default'
case: true

# Build settings
markdown: kramdown
Expand All @@ -81,7 +86,6 @@ plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-paginate-v2
- jekyll-archives
exclude:
- Gemfile
- Gemfile.lock
Expand Down
2 changes: 1 addition & 1 deletion _includes/_navigation.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="navbar-wrapper">
{% include shared/_navigation_banner.html %}

<nav class="navbar navbar-light navbar-main navbar-expand-lg">
<nav class="navbar navbar-main navbar-expand-lg">
<div class="container">
<a class="navbar-brand p-0 me-4" href="/">
<img alt="Angular.DE" src="/assets/img/logo.svg" width="45">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<main role="main">
<div class="container pt-5">
<h1>#{{ page.title }} Artikel</h1>
<h1>Artikel in #{% if page.autopages %}{{page.autopages.display_name}}{% endif %}</h1>
<ul class="posts">
{% for post in page.posts %}
{% for post in paginator.posts %}
<li>
<span class="post-date">{{ post.date | date: "%d.%m.%Y" }}</span>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
Expand Down
19 changes: 19 additions & 0 deletions _layouts/autopage_collection.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
layout: base
noindex: true
sitemap: false
---

<main role="main">
<div class="container pt-5">
<h1>Artikel in #{% if page.autopages %}{{page.autopages.display_name}}{% endif %}</h1>
<ul class="posts">
{% for post in paginator.posts %}
<li>
<span class="post-date">{{ post.date | date: "%d.%m.%Y" }}</span>
<a class="post-link" href="{{ post.url | relative_url }}">{{ post.title }}</a>
</li>
{% endfor %}
</ul>
</div>
</main>
2 changes: 1 addition & 1 deletion shared
Submodule shared updated 1 files
+2 −2 plugins/tab_banner.rb

0 comments on commit b9fcd83

Please sign in to comment.