- {%- if config.extra.meta_index.position %}
- {%- if config.extra.meta_index.position == "bottom" or config.extra.meta_index.position == "both" %}
- {{- macros::meta_index(page=page, config=config) }}
+ {%- if config.extra.meta_index?.position %}
+ {%- if config.extra.meta_index?.position == "bottom" or config.extra.meta_index?.position == "both" %}
+ {{}}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- if config.extra.arrow_pagination %}
- {{- macros::pagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{}}{% endif %}
{%- else %}
- {{- macros::numpagination(paginator=paginator, config=config) }}
+ {%- if paginator %}{{}}{% endif %}
{%- endif %}
{%- if config.extra.recent | default(value=true) %}
{#- The following line is checking if the template is being used for the root or a section #}
- {%- if current_path is matching("^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
+ {%- if current_path is matching(pat="^(/[[:alpha:]][[:alpha:]])?(/page/[[:digit:]]+)?/$") %}
{%- set sec = "" %}
{%- else %}
{%- if lang == config.default_language %}
- {%- set sec = current_path | trim_start_matches(pat="/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- else %}
- {%- set sec = current_path | trim_start_matches(pat="/" ~ lang ~ "/") | split(pat="/page/") | slice(end=1) | join(sep="") | trim_end_matches(pat="/") %}
+ {%- set sec = current_path | trim_start(pat="/" ~ lang ~ "/") | split(pat="/page/") | first | trim_end(pat="/") %}
{%- set sec = sec ~ "/" %}
{%- endif %}
{%- endif %}
@@ -90,10 +86,10 @@ This Template can also be used directly for the index eg: example.com/ or as the
{%- endif %}
- {{ macros::translate(key="Recent", default="Recent", i18n=i18n) }}
+ {{}}
{%- set recent_items=config.extra.recent_items | default(value=9) -%}
- {%- for page in section_item.pages | slice(end=recent_items) %}
- {{- macros::page_listing(page=page, config=config) }}
+ {%- for page in section_item.pages[:recent_items] -%}
+ {{}}
{%- endfor %}
-{%- 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 %}
diff --git a/templates/page.html b/templates/page.html
index 10ea571..6615602 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -1,43 +1,39 @@
-{# This Template Shows the Individual Blog Posts#}
-
-{% extends "base.html" %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title_addition = "" %}
- {%- if page.title and config.title %}
- {%- set title = page.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- elif page.title %}
- {%- set title = page.title %}
- {%- else %}
- {%- set title = config.title %}
- {%- endif %}
-
- {%- if page.description %}
- {%- set description = page.description %}
- {%- else %}
- {%- set description = config.description %}
- {%- endif %}
- {%- set created_time = page.date %}
- {%- set updated_time = page.updated %}
- {%- if current_section %}
- {%- set page_section = current_section %}
- {%- else %}
- {%- set page_section = "" %}
- {%- endif %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, type="article", is_page=true, created_time=created_time, updated_time=updated_time, page_section=page_section) }}
-{%- endblock seo %}
+{#- This Template Shows the Individual Blog Posts -#}
+{%- extends "base.html" -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title_addition = "" -%}
+ {%- if page.title and config.title -%}
+ {%- set title = page.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- elif page.title -%}
+ {%- set title = page.title -%}
+ {%- else -%}
+ {%- set title = config.title -%}
+ {%- endif -%}
+ {%- if page.description -%}
+ {%- set description = page.description -%}
+ {%- else -%}
+ {%- set description = config.description -%}
+ {%- endif -%}
+ {%- set created_time = page.date or "" -%}
+ {%- set updated_time = page.updated or page.date or "" -%}
+ {%- if current_section -%}
+ {%- set page_section = current_section -%}
+ {%- else -%}
+ {%- set page_section = "" -%}
+ {%- endif -%}
+ {{}}
+{%- endblock seo -%}
{%- block comments_init %}
- {%- if not config.extra.comment_system or config.extra.comment_system == "hyvor" and config.extra.comments.hyvor %}
+ {%- if config.extra.comment_system == "hyvor" and config.extra.comments?.hyvor %}
- {%- elif config.extra.comment_system == "remark42" and config.extra.comments.remark42 %}
+ {%- elif config.extra.comment_system == "remark42" and config.extra.comments?.remark42 %}
@@ -46,63 +42,59 @@
{%- block content %}
+ {%- block page_header -%}
+ {{}}
- {%- block page_header %}
- {{- macros::title_post(page=page, config=config) }}
-
- {%- if config.extra.meta_post.position %}
- {%- if config.extra.meta_post.position == "top" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page, config=config) }}
+ {%- if config.extra.meta_post?.position %}
+ {%- if config.extra.meta_post?.position == "top" or config.extra.meta_post?.position == "both" %}
+ {{}}
{%- endif %}{%- endif %}
{%- endblock page_header %}
- {# In Page Series Navigation #}
+ {#- In Page Series Navigation #}
{%- if config.extra.series | default(value=true) %}
{%- if page.extra.series %}
{%- set tag = get_taxonomy_term(kind="tags", term=page.extra.series, lang=lang) %}
- {%- set page_num = tag.page_count | as_str %}
+ {%- set page_num = tag.page_count | str %}
{%- if lang != config.default_language %}
- {%- set parts_string = macros::translate(key='Series_parts', default='Series', i18n=i18n) | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
- {% else %}
+ {%- set parts_string %}{{}}{%- endset %}
+ {%- set parts_string = parts_string | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
+ {%- else %}
{%- set parts_string = config.extra.Series_parts | default(value="Series") | replace(from="$NUMBER_OF_PARTS", to=page_num) %}
- {% endif -%}
+ {%- endif %}
-
-
- {{ tag.name }} ({{ parts_string }})
- {%- for inner in tag.pages | sort(attribute="date") %}
- {%- if inner.content == page.content %}
- {{ inner.title }}
- {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #}
- {% else %}
- {{ inner.title }}
- {%- endif %}
- {%- endfor %}
+
+
+ {{ tag.name }} ({{ parts_string }})
+ {%- for inner in tag.pages | sort(attribute="date") %}
+ {%- if inner.content == page.content %}
+ {{ inner.title }}
+ {%- set_global current_section_index = loop.index0 %} {# Finds the current section, needed for pagination logic later #}
+ {%- else %}
+ {{ inner.title }}
+ {%- endif %}
+ {%- endfor %}
+
-
{%- endif %}
{%- endif %}
-
{{ page.content | safe }}
-
- {%- if config.extra.meta_post.position %}
- {%- if config.extra.meta_post.position == "bottom" or config.extra.meta_post.position == "both" %}
- {{- macros::meta_post(page=page, config=config) }}
+ {%- if config.extra.meta_post?.position %}
+ {%- if config.extra.meta_post?.position == "bottom" or config.extra.meta_post?.position == "both" %}
+ {{}}
{%- endif %}{%- endif %}
{%- block page_footer %}
- {{- macros::footer(page=page, config=config) }}
+ {{}}
{%- endblock page_footer %}
{%- block comments_body %}
- {%- if not config.extra.comment_system or config.extra.comment_system == "hyvor" %}
- {%- if config.extra.comments.hyvor %}
-
- {%- endif %}
- {%- elif config.extra.comment_system == "remark42" and config.extra.comments.remark42 %}
+ {%- if config.extra.comment_system == "hyvor" and config.extra.comments?.hyvor %}
+
+ {%- elif config.extra.comment_system == "remark42" and config.extra.comments?.remark42 %}
{%- endif %}
{%- endblock comments_body %}
@@ -113,77 +105,75 @@
{%- set toc = page.toc %}
{%- endif %}
{%- if toc or page.extra.series %}
-
{%- if page.extra.series %}
{%- set num_extra_pages = config.extra.series_items | default(value=9) %}
{{ parts_string }}
{%- if tag.page_count > num_extra_pages and num_extra_pages > 0 %}
- {%- set sorted_array = tag.pages | sort(attribute="date") %}
- {%- set num_pages = tag.page_count %}
-
- {# Shows the first 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 %}
-
- {{ macros::translate(key="more", default="more", i18n=i18n) | title }}...
-
-
- {%- endif %}
+ {%- set sorted_array = tag.pages | sort(attribute="date") -%}
+ {%- set num_pages = tag.page_count %}
+ {#- Shows the first page -#}
+ {{}}
+
+ {#- Hides the next couple of pages if the current section is more than 3 away from start #}
+ {%- if current_section_index > 3 %}
+
+ {% set _m %}{{}}{% endset %}{{ _m | title }}...
+
+
+ {%- for inner in sorted_array[1:(current_section_index - 2)] %}
+ {{ inner.title }}
+ {%- endfor %}
+
+ {%- endif %}
- {# Max(current_section_index - 2, 1) #}
+ {#- Max(current_section_index - 2, 1) #}
{%- if (current_section_index - 2 ) > 1 %}
{%- set num = current_section_index - 2 %}
{%- else %}
{%- set num = 1 %}
{%- endif %}
- {# Shows two pages before current page #}
- {%- for inner in sorted_array | slice(start=num, end=current_section_index) %}
- {{ inner.title }}
+ {#- Shows two pages before current page #}
+ {%- for inner in sorted_array[num:current_section_index] %}
+ {{ inner.title }}
{%- endfor %}
- {# Shows the current page #}
+ {#- 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, config=config) }}
+ {{}}
{%- endif %}
- {# Min(num_pages - 1, current_section_index + 3) #}
+ {#- Min(num_pages - 1, current_section_index + 3) #}
{%- if (num_pages - 2 ) < (current_section_index + 3) %}
{%- set num = num_pages - 1 %}
{%- else %}
{%- set num = current_section_index + 3 %}
{%- endif %}
- {%- for inner in sorted_array | slice(start=(current_section_index + 1), end=num ) %}
+ {%- for inner in sorted_array[(current_section_index + 1):num] %}
{{ inner.title }}
- {% endfor %}
+ {%- endfor %}
{%- if current_section_index < num_pages - 4 %}
- {{ macros::translate(key="more", default="more", i18n=i18n) | title }}...
+ {% set _m %}{{}}{% endset %}{{ _m | title }}...
- {%- for inner in sorted_array | slice(start=(current_section_index + 3), end=(num_pages - 1)) %}
+ {%- for inner in sorted_array[(current_section_index + 3):(num_pages - 1)] %}
{{ inner.title }}
{%- endfor %}
{%- endif %}
- {%- set last = num_pages - 1%}
- {{ macros::series_link(inner=sorted_array[last], page=page, config=config) }}
+ {%- set last = num_pages - 1 -%}
+ {{}}
- {# If there is not more than max pages render normally #}
+ {#- 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, config=config) }}
+ {{}}
{%- endfor %}
{%- endif %}
{% for term in terms %} #{{ term.name }}{{ term.pages | length }} {% endfor %}
{%- for term in terms %}
diff --git a/templates/tags/single.html b/templates/tags/single.html
index eb1d77a..b507ceb 100644
--- a/templates/tags/single.html
+++ b/templates/tags/single.html
@@ -1,22 +1,17 @@
-{% extends "base.html" %}
+{%- extends "base.html" -%}
{%- set uglyurls = config.extra.uglyurls | default(value=false) -%}
-{%- if config.extra.search_library %}{%- if config.extra.search_library == "offline" %}{% set uglyurls = true %}{% endif %}{% endif %}
-
-{%- block seo %}
- {{- super() }}
- {%- set title = term.name ~ " tag" %}
-
- {%- if config.title %}
- {%- set title_addition = title_separator ~ config.title %}
- {%- else %}
- {%- set title_addition = "" %}
- {%- endif %}
-
- {%- set description = config.description %}
-
- {{- macros_seo::seo(config=config, title=title, title_addition=title_addition, description=description, is_home=true) }}
-{%- endblock seo %}
-
+{%- if config.extra.search_library -%}{%- if config.extra.search_library == "offline" -%}{%- set uglyurls = true -%}{%- endif -%}{%- endif -%}
+{%- block seo -%}
+ {{- super() -}}
+ {%- set title = term.name ~ " tag" -%}
+ {%- if config.title -%}
+ {%- set title_addition = title_separator ~ config.title -%}
+ {%- else -%}
+ {%- set title_addition = "" -%}
+ {%- endif -%}
+ {%- set description = config.description -%}
+ {{}}
+{%- endblock seo -%}
{%- block content %}
{{ term.name }}
diff --git a/theme.toml b/theme.toml
index b879469..2340f7f 100644
--- a/theme.toml
+++ b/theme.toml
@@ -2,7 +2,7 @@ name = "abridge"
description = "A fast and lightweight Zola theme using semantic html, a class-light abridge.css, and No mandatory JS."
license = "MIT"
homepage = "https://github.com/jieiku/abridge"
-min_version = "0.19.1"
+min_version = "0.23.3"
demo = "https://abridge.pages.dev/"
# Abridge theme author info
diff --git a/zola.toml b/zola.toml
new file mode 100644
index 0000000..52e4625
--- /dev/null
+++ b/zola.toml
@@ -0,0 +1,400 @@
+# do NOT include a trailing slash on the base URL
+base_url = "https://abridge.netlify.app"
+# Usable site directly from disk, Including Search: "/home/jieiku/.dev/abridge/public"
+# Also set index format = "elasticlunr_javascript", and in [extra] uglyurls = true, integrity = false
+# If you use the npm/node script then all you have to do is set search_library = "offline", and everything else is automatic.
+
+title = "Abridge"
+description = "Abridge is a fast, lightweight, and modern Zola theme (class-light, semantic HTML). Perfect Lighthouse, YellowLabTools, and Observatory scores."#for SEO aim for 140-180 Characters
+#theme = "abridge"
+
+default_language = "en"
+compile_sass = true
+minify_html = false
+build_search_index = true
+generate_feeds = true
+taxonomies = [
+# {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+#ignored_content = []
+#ignored_static = ["apple-touch-icon.png","banner.png","safari-pinned-tab.svg","favicon*","m*.png","android-chrome*png"]
+
+#feed_filename = "atom.xml"
+#output_dir = "public"
+#ignored_content = ["*.{graphml,xlsx}", "temp.*"]
+#hard_link_static = false # set to true to hard link instead of copying, useful for very large files.
+
+[search] # Options specific to elasticlunr search.
+# index format can be: elasticlunr_json or elasticlunr_javascript or fuse_json
+index_format = "elasticlunr_json"
+include_title = true # include title of page/section in index
+include_description = true # include description of page/section in index
+include_content = true # include rendered content of page/section in index
+# truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large.
+
+[markdown]
+bottom_footnotes = true # adds footnote backreference
+render_emoji = false
+external_links_target_blank = true # rel="noopener"
+external_links_no_follow = false # rel="nofollow"
+external_links_no_referrer = false # rel="noreferrer"
+smart_punctuation = false # `...` to `…`, `"quote"` to `“curly”` etc
+
+[markdown.highlighting]
+theme = "plastic" #The plastic syntax theme is lightweight, but the colors are defined in abridge _colors-syntax.scss (not really the plastic theme, and you can change the colors to whatever you want)
+error_on_missing_language = true
+style = "class"
+
+# Any Extra language you do not use, delete or comment out the extra language sections:
+[languages.fr]
+title = "Abridge"
+description = "Abridge est un thème Zola rapide et léger utilisant le html sémantique, le CSS abridge.css class-light et aucun JS obligatoire."
+generate_feeds = true
+build_search_index = true
+search.include_title = true # include title of page/section in index
+search.include_description = true # include description of page/section in index
+search.include_content = true # include rendered content of page/section in index
+# search.truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large.
+taxonomies = [
+# {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+[languages.es]
+title = "Abridge"
+description = "Abridge es un tema de Zola rápido y liviano que utiliza HTML semántico, CSS ligero de clase abridge.css y JS no obligatorio."
+generate_feeds = true
+build_search_index = true
+search.include_title = true # include title of page/section in index
+search.include_description = true # include description of page/section in index
+search.include_content = true # include rendered content of page/section in index
+# search.truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large.
+taxonomies = [
+# {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+[languages.pt]
+title = "Abridge"
+description = "Abridge é um tema rápido e leve que usa HTML semântico, CSS de clase leve abridge.css y JS não obrigatório."
+generate_feeds = true
+build_search_index = true
+search.include_title = true # include title of page/section in index
+search.include_description = true # include description of page/section in index
+search.include_content = true # include rendered content of page/section in index
+# search.truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large.
+taxonomies = [
+# {name = "categories", feed = true},
+ {name = "tags", feed = true},
+]
+
+[extra]
+###############################################################################
+### Layout & Format
+### position: top, bottom, both, false(hidden)
+### size: s150, s140, s130, s120, s110, s95, s90, s85, s80, s75, s70, false(full size)
+### divider: " " "·" "•"
+###############################################################################
+
+menu = [
+# {url = "blog", name = "Blog", slash = true, blank = false, size="s110"},
+# {url = "about", name = "About", slash = true, blank = false, size="s110"},
+ {url = "archive", name = "Posts", slash = true, blank = false, size="s110"},
+# {url = "categories", name = "Categories", slash = true, blank = false, size="s110"},
+ {url = "tags", name = "Tags", slash = true, blank = false, size="s110"},
+]
+menu_footer = [
+ {url = "about", name = "About", slash = true, blank = false, size="s90"},
+ {url = "contact", name = "Contact", slash = true, blank = false, size="s90"},
+ {url = "privacy", name = "Privacy", slash = true, blank = false, size="s90"},
+ {url = "sitemap.xml", name = "Sitemap", slash = false, blank = true, size="s90"},
+]
+
+toc = true
+recent = true # TOC / index
+recent_items = 15
+series = true
+series_items = 9 # Max number of items to display in series list, use 0 to disable
+#Series_parts = "$NUMBER_OF_PARTS part Series"
+
+#arrow_pagination = true # If set to true then the pagination will use the old arrows mode, be sure to also enable the icons.
+
+meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, updated=false, categories_tags=true, divider="" }
+meta_post = { position="top", size="s95", author=true, readtime=false, readstring="min read", date=true, updated=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"
+footer_size = "s80" # the size of the copyright and powered by text
+footer_credit = true
+#footer_credit_override = '