diff options
| author | Jieiku | 2023-09-27 12:48:48 -0700 |
|---|---|---|
| committer | Jieiku | 2023-09-27 12:48:48 -0700 |
| commit | 0968b8ffbae62db8fcbb2f724d61bf24642072e2 (patch) | |
| tree | 3bf4b1ca36e73ee3c01efb43f93af7bc97450fd2 /templates | |
| parent | f5d32f6032ea172d0f1076b1fa04c96c9205285b (diff) | |
| download | abridge-0968b8ffbae62db8fcbb2f724d61bf24642072e2.tar.gz abridge-0968b8ffbae62db8fcbb2f724d61bf24642072e2.tar.bz2 abridge-0968b8ffbae62db8fcbb2f724d61bf24642072e2.zip | |
Fixes for Offline Site Build
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/macros/macros.html | 5 | ||||
| -rw-r--r-- | templates/page.html | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/templates/macros/macros.html b/templates/macros/macros.html index d0ce1a0..21c943d 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -11,8 +11,9 @@ {%- endmacro page_listing %} -{%- macro series_link(inner, page) %} - {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- macro series_link(inner, page, config) %} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} {%- if inner.content == page.content %} <li><a href="{{ inner.permalink | safe }}{%- if uglyurls %}index.html{%- endif %}"><b>{{ inner.title }}</b></a></li> {% else %} diff --git a/templates/page.html b/templates/page.html index f5ca311..b362877 100644 --- a/templates/page.html +++ b/templates/page.html @@ -112,7 +112,7 @@ {%- set num_pages = tag.page_count %} {# Shows the first page #} - {{ macros::series_link(inner=sorted_array.0, page=page) }} + {{ macros::series_link(inner=sorted_array.0, page=page, config=config) }} {# Hides the next couple of pages if the current section is more than 3 away from start #} {%- if current_section_index > 3 %} @@ -140,7 +140,7 @@ {# Shows the current page #} {%- if current_section_index != 0 and current_section_index != (num_pages - 1) %} - {{ macros::series_link(inner=sorted_array[current_section_index], page=page) }} + {{ macros::series_link(inner=sorted_array[current_section_index], page=page, config=config) }} {%- endif %} {# Min(num_pages - 1, current_section_index + 3) #} @@ -166,12 +166,12 @@ {%- endif %} {%- set last = num_pages - 1%} - {{ macros::series_link(inner=sorted_array[last], page=page) }} + {{ macros::series_link(inner=sorted_array[last], page=page, config=config) }} {# If there is not more than max pages render normally #} {%- else %} {%- for inner in tag.pages | sort(attribute="date") %} - {{ macros::series_link(inner=inner, page=page) }} + {{ macros::series_link(inner=inner, page=page, config=config) }} {%- endfor %} {%- endif %} </ol> |
