diff options
| author | Jake G | 2023-06-16 10:36:39 -0700 |
|---|---|---|
| committer | GitHub | 2023-06-16 10:36:39 -0700 |
| commit | 45337eff2f7cd132b94e52ff6c4aca4c4082fa8b (patch) | |
| tree | c660ccbc836f47f0e8750bcd5408338e234f3557 | |
| parent | 28052596836f4c8ca823cfa5a904a6a48f2965a4 (diff) | |
| parent | eade3b10759e73c99facb55e7f258f6d98f41b5a (diff) | |
| download | abridge-45337eff2f7cd132b94e52ff6c4aca4c4082fa8b.tar.gz abridge-45337eff2f7cd132b94e52ff6c4aca4c4082fa8b.tar.bz2 abridge-45337eff2f7cd132b94e52ff6c4aca4c4082fa8b.zip | |
Merge pull request #123 from wold5/refactor
add paginator on post page (v2)
| -rw-r--r-- | config.toml | 1 | ||||
| -rw-r--r-- | sass/abridge.scss | 6 | ||||
| -rw-r--r-- | templates/macros/macros.html | 20 | ||||
| -rw-r--r-- | templates/page.html | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/config.toml b/config.toml index f5fc2b7..6b65a04 100644 --- a/config.toml +++ b/config.toml @@ -121,6 +121,7 @@ meta_index = { position="bottom", size="s90", author=false, readtime=false, read meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, categories_tags=true, divider=" " } hide_section_dates = false # hides the date for sections that use posts.html as their template. +hide_page_nextprev_titles = false # hides the next/previous titles for pages that use page.html as their template. title_size_index = "s85" # size: s95, s90, s85, s80, s75, s70, false(full size) footer_size = "s90" # size: s95, s90, s85, s80, s75, s70, false(full size) footer_credit = true 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 34ab651..bc38935 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -118,12 +118,26 @@ -{%- macro footer(page) %} -{%- if page.reading_time %} -{%- if page.reading_time > 2 %} +{%- macro footer(page, config) %} +{%- 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 not config.extra.hide_page_nextprev_titles | default(value=false) %} +{% 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 %} +{%- endif %} +</nav> {%- endmacro footer %} diff --git a/templates/page.html b/templates/page.html index c92e49c..979e0a1 100644 --- a/templates/page.html +++ b/templates/page.html @@ -47,7 +47,7 @@ {%- endif %}{%- endif %} {%- block page_footer %} - {{- macros::footer(page=page) }} + {{- macros::footer(page=page, config=config) }} {%- endblock page_footer %} </article> {%- block toc %} |
