diff options
-rw-r--r-- | _config.yml | 8 | ||||
-rw-r--r-- | _includes/header.html | 4 | ||||
-rw-r--r-- | _includes/pagetrail.html | 13 | ||||
-rw-r--r-- | _layouts/home.html | 5 | ||||
-rw-r--r-- | assets/main.scss | 17 |
5 files changed, 43 insertions, 4 deletions
diff --git a/_config.yml b/_config.yml index 4b8713e..a212703 100644 --- a/_config.yml +++ b/_config.yml @@ -44,6 +44,10 @@ mastodon: #show_excerpts: true pagination: - enabled: false - per_page: 5 + enabled: true + per_page: 10 title: ":title (Seite :num)" + sort_reverse: true + trail: + before: 5 + after: 5 diff --git a/_includes/header.html b/_includes/header.html index dc42cdd..b3489c2 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -19,9 +19,9 @@ that are automatically created by the gem. Check for non-existence to exclude pagination pages from site.pages iterators --> - <!-- add exclusion of /index to avoid having the link twice --> + <!-- add exclusion of /index to avoid having the link twice --> - {% for my_page in site.pages %} + {% for my_page in site.pages %} {% if my_page.title and my_page.autogen == nil and my_page.url != "/index.html" %} <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a> {% endif %} diff --git a/_includes/pagetrail.html b/_includes/pagetrail.html new file mode 100644 index 0000000..7ce2712 --- /dev/null +++ b/_includes/pagetrail.html @@ -0,0 +1,13 @@ +<div class="pagetrail"> +{% if paginator.page_trail %} + {% for trail in paginator.page_trail %} + <a + href="{{ trail.path | prepend: site.baseurl }}" + title="{{trail.title}}" + {% if page.url == trail.path %} + class="current_pagelink" + {% endif %} + >{{ trail.num }}</a> + {% endfor %} +{% endif %} +</div> diff --git a/_layouts/home.html b/_layouts/home.html index cb212bb..f06c5f6 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -10,6 +10,9 @@ layout: default {{ content }} {%- if site.posts.size > 0 -%} + + {% include pagetrail.html %} + <h2 class="post-list-heading">{{ page.list_title | default: "Posts" }}</h2> <ul class="post-list"> {% if paginator == nil %} @@ -32,6 +35,8 @@ layout: default {%- endfor -%} </ul> + {% include pagetrail.html %} + <p class="rss-subscribe">subscribe <a href="{{ "/feed.xml" | relative_url }}">via RSS</a></p> {%- endif -%} diff --git a/assets/main.scss b/assets/main.scss index e55421c..76f78cb 100644 --- a/assets/main.scss +++ b/assets/main.scss @@ -11,3 +11,20 @@ code { tfoot td { font-style: italic; } + +div.pagetrail { + margin-bottom: 2ex; +} + +div.pagetrail a { + font-weight: bold; + border-left: 1px solid black; + border-right: 1px solid black; + padding: 0.25em; +} + +div.pagetrail a.current_pagelink { + font-weight: unset; + background: $brand-color; + color: white; +} |