diff options
| author | William Ouwehand | 2023-06-16 17:33:03 +0200 |
|---|---|---|
| committer | William Ouwehand | 2023-06-16 17:33:03 +0200 |
| commit | 60b1bfea5d2eba0a1f1c9807087635c0abc6cfd0 (patch) | |
| tree | bacbf1c40c65799fe9ce2f6469a6d2e8c128d816 | |
| parent | f548a928a3e271891e16e811ebce4a997f96ef5b (diff) | |
| download | abridge-60b1bfea5d2eba0a1f1c9807087635c0abc6cfd0.tar.gz abridge-60b1bfea5d2eba0a1f1c9807087635c0abc6cfd0.tar.bz2 abridge-60b1bfea5d2eba0a1f1c9807087635c0abc6cfd0.zip | |
Add prev/next page title paginator
| -rw-r--r-- | sass/abridge.scss | 6 | ||||
| -rw-r--r-- | templates/macros/macros.html | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sass/abridge.scss b/sass/abridge.scss index f5c69c0..4efd6dd 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -656,6 +656,12 @@ $syntax: true !default;//syntax highlighting for code blocks a,span { margin: .2rem; } + &:last-child //prev/next page title + { + div:last-child { + text-align: right; + } + } } footer nav > a { margin: .2rem; diff --git a/templates/macros/macros.html b/templates/macros/macros.html index dd718e7..ee5f896 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -122,7 +122,20 @@ {%- if page.reading_time and page.reading_time > 2 %} <p><b><a href="#">Back to top</a></b></p> {%- endif %} +<nav><!-- prev/next page title. Keep for CSS selector even if empty --> +{% if page.lower or page.higher-%} + <div> + {% if page.lower -%} + <a href="{{ page.lower.permalink | safe }}">‹ {{ page.lower.title | truncate(length=100) }}</a> + {%- endif %} + </div> + <div> + {% if page.higher -%} + <a href="{{ page.higher.permalink | safe }}"> {{ page.higher.title | truncate(length=100) }} ›</a> + {%- endif %} + </div> {%- endif %} +</nav> {%- endmacro footer %} |
