From c2d72e09747a2a4abe9602e1ba49a1b4649c9d3c Mon Sep 17 00:00:00 2001 From: Jieiku Date: Fri, 14 Aug 2026 15:10:15 -0700 Subject: Update for Zola 0.23.3 --- templates/macros/macros.html | 378 ------------------------------------------- templates/macros/seo.html | 145 ----------------- 2 files changed, 523 deletions(-) delete mode 100644 templates/macros/macros.html delete mode 100644 templates/macros/seo.html (limited to 'templates/macros') diff --git a/templates/macros/macros.html b/templates/macros/macros.html deleted file mode 100644 index 84ad119..0000000 --- a/templates/macros/macros.html +++ /dev/null @@ -1,378 +0,0 @@ -{%- macro translate(key, i18n="", default="") %} -{{- i18n[key] | default(value=default) | safe -}} -{%- endmacro %} - -{%- macro page_listing(page, config) %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} -
- {{ page.title | markdown(inline=true) | safe }} -
-{%- endmacro page_listing %} - - -{%- macro series_link(inner, page, config) %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - {%- if inner.content == page.content %} - {{ inner.title }}
- {% else %} - {{ inner.title }}
- {%- endif %} -{%- endmacro %} - - -{%- macro title_post(page, config) %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} -

{{ page.title | markdown(inline=true) | safe }}

-{%- endmacro title_post %} - - - -{%- macro meta_post(page, config) %} -{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} -{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} -{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} - -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - - - {#- Author #} - {%- if page.taxonomies.authors and config.taxonomies %} - {%- for author in page.taxonomies.authors %} - {%- if author_flag %}, {% endif %} - {{ author }} - {%- set_global author_flag = true %} - {%- endfor %} - {%- elif page.extra.authors and config.extra.meta_post.author %} - {%- if config.extra.icon_author %} {% endif %} - {%- for author in page.extra.authors %} - {%- if author_flag %}, {% endif %} {{ author }} - {%- set_global author_flag = true %} - {%- endfor %} - {%- elif config.extra.author and config.extra.meta_post.author %} - {%- if config.extra.icon_author %} {% endif %} {{ config.extra.author }} - {%- endif %} - - {#- divider #} - {%- if config.extra.meta_post.author %} - {%- if config.extra.meta_post.readtime or config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %} - {%- endif %} - {%- endif %} - - {#- ReadTime #} - {%- if config.extra.meta_post.readtime %} {%- if config.extra.icon_read %} {% endif %} {{ page.reading_time }} {{ config.extra.meta_post.readstring | default(value="min") }} - {#- divider #} - {%- if config.extra.meta_post.date or config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} - - {#- Date #} - {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %} {% endif %} - {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} - {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) -%} - {%- if page_date %} {{ page_date }} {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} - {#- divider #} - {%- if config.extra.meta_post.updated or config.extra.meta_post.categories_tags %} - {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} - - {#- Updated #} - {%- if config.extra.meta_post.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} - {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}: - {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} - {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) -%} - {%- if page_updated %} {{ page_updated }} {%- else %} {{ page.updated | date(format="%B %d, %Y") }} {%- endif %} - {#- divider #} - {%- if config.extra.meta_post.categories_tags %} - {%- 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 }}{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %} - - {#- Tags #} - {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} -{%- endmacro meta_post %} - - - -{%- macro title_index(page, config) %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - {% if config.extra.title_size_index %}{% endif %}{{ page.title | markdown(inline=true) | safe }}{% if config.extra.title_size_index %}{% endif %} -{%- endmacro title_index %} - - - -{%- macro meta_index(page, config) %} -{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} -{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} -{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - - - {#- Author #} - {%- if page.taxonomies.authors and config.taxonomies %} - {%- for author in page.taxonomies.authors %} - {%- if author_flag %}, {% endif %} - {{ author }} - {%- set_global author_flag = true %} - {%- endfor %} - {%- elif page.extra.authors and config.extra.meta_index.author %} - {%- if config.extra.icon_author %} {% endif %} - {%- for author in page.extra.authors %} - {%- if author_flag %}, {% endif %} {{ author }} - {%- set_global author_flag = true %} - {%- endfor %} - {%- elif config.extra.author and config.extra.meta_index.author %} - {%- if config.extra.icon_author %} {% endif %} {{ config.extra.author }} - {%- endif %} - - {#- divider #} - {%- if config.extra.meta_index.author %} - {%- if config.extra.meta_index.readtime or config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %} - {%- endif %} - {%- endif %} - - {#- ReadTime #} - {%- if config.extra.meta_index.readtime %} {%- if config.extra.icon_read %} {% endif %} {{ page.reading_time }} {{ config.extra.meta_index.readstring | default(value="min") }} - {#- divider #} - {%- if config.extra.meta_index.date or config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} - - {#- Date #} - {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %} {% endif %} - {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} - {%- set page_date = page.date | date(format="%B %d, %Y", locale=lang_locale) -%} - {%- if page_date %} {{ page_date }} {%- else %} {{ page.date | date(format="%B %d, %Y") }} {%- endif %} - {#- divider #} - {%- if config.extra.meta_index.updated or config.extra.meta_index.categories_tags %} - {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} - - {#- Updated #} - {%- if config.extra.meta_index.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} - {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}: - {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} - {%- set page_updated = page.updated | date(format="%B %d, %Y", locale=lang_locale) -%} - {%- if page_updated %} {{ page_updated }} {%- else %} {{ page.updated | date(format="%B %d, %Y") }} {%- endif %} - {#- divider #} - {%- if config.extra.meta_index.categories_tags %} - {%- 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 }}{%- if not loop.last %}, {% endif %}{% endfor %}]{% endif %} - - {#- Tags #} - {%- 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.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% 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 %} - - {%- endif %} - {%- endif %} -{%- endmacro footer %} - - - -{%- macro pagination(paginator, config)%} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - {%- if paginator.number_pagers > 1 %} - {%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #} - {%- set start = 1 %} - {%- set end = paginator.number_pagers %} - {%- endif %} - - {%- if paginator.number_pagers > 5 %} - - {%- if paginator.current_index >= 3 %} {# Check if the first number will be 1 or not #} - {%- set start = paginator.current_index - 2 %} {# Set the start number #} - {%- if paginator.number_pagers - paginator.current_index < 2 %} {# the last two pages your no longer centered with equal pages start and end #} - {%- set difference = paginator.number_pagers - paginator.current_index %} - {%- set compensation = 1 - difference %} - {%- set start = paginator.current_index - 3 - compensation %} {# however many pages are missing on the end, add offset to start #} - {%- endif %} - {%- else %} - {%- set start = 1 %} - {%- endif %} - - {%- if paginator.number_pagers >= paginator.current_index + 2 %} {# Check if the last page is beyond our range #} - {%- set end = paginator.current_index + 2 %} {# End is beyond our range so we can safely set it to our range #} - {%- if paginator.current_index <= 3 %} {# check offset start, if on page 1 or 2 then set the end to page 5 #} - {%- set end = 5 %} - {%- endif %} - {%- else %} - {%- set end = paginator.number_pagers %} - {%- endif %} - {%- endif %} - - {%- endif %} -{%- endmacro %} - - - -{%- macro numpagination(paginator, config)%} -{%- set uglyurls = config.extra.uglyurls | default(value=false) -%} -{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %} - {%- if paginator.number_pagers > 1 %} - {%- if paginator.number_pagers <= 5 %} {# 5 or less pager is simple, just display all 5 #} - {%- set start = 1 %} - {%- set end = paginator.number_pagers %} - {%- endif %} - - {%- if paginator.number_pagers > 5 %} - - {%- if paginator.current_index >= 3 %} {# Check if the first number will be 1 or not #} - {%- set start = paginator.current_index - 2 %} {# Set the start number #} - {%- if paginator.number_pagers - paginator.current_index < 2 %} {# the last two pages your no longer centered with equal pages start and end #} - {%- set difference = paginator.number_pagers - paginator.current_index %} - {%- set compensation = 1 - difference %} - {%- set start = paginator.current_index - 3 - compensation %} {# however many pages are missing on the end, add offset to start #} - {%- endif %} - {%- else %} - {%- set start = 1 %} - {%- endif %} - - {%- if paginator.number_pagers >= paginator.current_index + 2 %} {# Check if the last page is beyond our range #} - {%- set end = paginator.current_index + 2 %} {# End is beyond our range so we can safely set it to our range #} - {%- if paginator.current_index <= 3 %} {# check offset start, if on page 1 or 2 then set the end to page 5 #} - {%- set end = 5 %} - {%- endif %} - {%- else %} - {%- set end = paginator.number_pagers %} - {%- endif %} - {%- endif %} - - {%- endif %} -{%- endmacro %} diff --git a/templates/macros/seo.html b/templates/macros/seo.html deleted file mode 100644 index d8853be..0000000 --- a/templates/macros/seo.html +++ /dev/null @@ -1,145 +0,0 @@ -{#- type: website or article, generally setting article for blog articles -#} -{#- page_images: using for the blog single template page -#} -{#- page_section: the blog single template page have to pass the parameter -#} -{#- is_404: using for the 404.html template -#} - -{%- macro seo( config, title="", title_addition="", description="", type="website", is_home=false, is_404=false, is_page=false, page_images="", page_section="", created_time="2023-05-15T07:07:00-07:00", updated_time="2023-05-15T07:07:00-07:00" ) %} - -{#- Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} -{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} -{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} -{%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} - -{%- if is_404 -%} - -{%- else -%} - - - -{%- endif -%} - -{%- if current_url %} - {%- set page_url = current_url %} -{%- else %} - {%- set page_url = get_url(path="404.html", trailing_slash=true) %} -{%- endif %} - {{ title ~ title_addition }} - -{%- if config.extra.author %} - -{%- endif %} -{%- if config.extra.facebook_publisher %} - -{%- endif %} - -{%- if config.extra.facebook_author %} - -{%- endif %} -{%- if page.description %} - -{%- else %} - -{%- endif %} - -{%- if page.extra.keywords and config.extra.keywords %} - -{%- elif page.extra.keywords %} - -{%- elif config.extra.keywords %} - -{%- endif %} - -{#- Extra SEO START #} -{%- if config.extra.seo | default(value=true) %} -{%- if not is_404 %} - -{%- if config.extra.google %} - -{%- endif %} - -{%- if config.extra.bing %} - -{%- endif %} - - - -{%- if page.description %} - - -{%- else %} - - -{%- endif %} - -{%- if page.title %} - - -{%- else %} - - -{%- endif %} - - -{#- SEO MEDIA START #} -{%- if page.extra.thumbnail %} - - - - -{%- elif page.extra.static_thumbnail %} - - {%- if page.extra.static_thumbnail is matching("^http[s]?://") %} - - - {%- else %} - - - {%- endif %} - -{%- elif config.extra.banner %} - - - - -{%- else %} - - -{%- endif %} - -{%- if config.extra.open.audio %} - -{%- endif %} - -{%- if config.extra.open.locale %} - -{%- endif %} - -{%- if config.extra.open.videos %} - {%- for video in config.extra.open.videos %} - - {%- endfor %} -{%- endif %} - -{#- SEO MEDIA END #} - - - -{%- if page.updated %} - -{%- elif page.date %} - -{%- else %} - -{%- endif %} - -{%- if config.extra.twitter_meta %} - - -{%- endif %} - - - -{%- endif %} -{%- endif %} -{#- Extra SEO END #} -{%- endmacro %} -- cgit v1.3.1