From 5e55301cc2c91a5f0e99000bfe4d7ec262ee78c1 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Fri, 8 Sep 2023 15:08:39 -0700 Subject: Refactor package.json --- templates/macros/macros.html | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'templates/macros/macros.html') diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 1a033cf..000130a 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,15 +1,19 @@ {%- macro title_post(page, config) %} -

{{ page.title }}

+{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} +

{{ page.title }}

{%- endmacro title_post %} {%- macro meta_post(page, config) %} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} {#- Author #} {%- if page.taxonomies.authors and config.taxonomies %} {%- for author in page.taxonomies.authors %} {%- if author_flag %}, {% endif %} - {{ author }} + {{ author }} {%- set_global author_flag = true %} {%- endfor %} {%- elif page.extra.authors and config.extra.meta_post.author %} @@ -64,25 +68,29 @@ {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} {#- Categories #} - {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} {#- Tags #} - {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- endmacro meta_post %} {%- macro title_index(page, config) %} -

{% if config.extra.title_size_index %}{% endif %}{{ page.title }}{% if config.extra.title_size_index %}{% endif %}

+{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} +

{% if config.extra.title_size_index %}{% endif %}{{ page.title }}{% if config.extra.title_size_index %}{% endif %}

{%- endmacro title_index %} {%- macro meta_index(page, config) %} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} {#- Author #} {%- if page.taxonomies.authors and config.taxonomies %} {%- for author in page.taxonomies.authors %} {%- if author_flag %}, {% endif %} - {{ author }} + {{ author }} {%- set_global author_flag = true %} {%- endfor %} {%- elif page.extra.authors and config.extra.meta_index.author %} @@ -138,28 +146,30 @@ {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %}   {%- endif %}{%- endif %}{% endif %} {#- Categories #} - {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %} {% endif %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} {#- Tags #} - {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- endmacro meta_index %} {%- macro footer(page, config) %} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} {#- prev/next content page nextprev title pagination #} {%- if not config.extra.hide_page_nextprev_titles | default(value=false) %} {%- if page.lower or page.higher %} @@ -169,6 +179,8 @@ {%- macro pagination(paginator, config)%} +{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} +{%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} {%- if paginator.number_pagers > 1 %} {%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #} {%- set start = 1 %} @@ -203,7 +215,7 @@ {%- set icon_next=config.extra.icon_next | default(value="svgs svgh angr") -%} {%- set icon_last=config.extra.icon_last | default(value="svgs svgh angrr") -%} {%- if paginator.previous -%} - + {%- if icon_first -%} {%- else -%}« {%- endif -%} @@ -217,7 +229,7 @@ {%- endif -%} {%- if paginator.previous -%} - + {%- if icon_prev -%} {%- else -%}‹ {%- endif -%} @@ -234,14 +246,14 @@ {%- if i == paginator.current_index -%} {{i}} {%- elif i > 1 -%} - {{i}} + {{i}} {%- else -%} - {{ i }} + {{ i }} {%- endif -%} {%- endfor -%} {%- if paginator.next -%} - + {%- if icon_next -%} {%- else -%}› {%- endif -%} @@ -255,7 +267,7 @@ {%- endif -%} {%- if paginator.next -%} - + {%- if icon_last -%} {%- else -%}» {%- endif -%} -- cgit v1.3.1