{#- 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 config.extra.comment_system == "hyvor" and config.extra.comments?.hyvor %} {%- elif config.extra.comment_system == "remark42" and config.extra.comments?.remark42 %} {%- endif %} {%- endblock comments_init %} {%- block content %}
{%- block page_header -%} {{}} {%- 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 #} {%- 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 | str %} {%- if lang != config.default_language %} {%- 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 %}
{{ 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" %} {{}} {%- endif %}{%- endif %} {%- block page_footer %} {{
}} {%- endblock page_footer %} {%- block comments_body %} {%- 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 %}
{%- block toc %} {%- if config.extra.toc | default(value=true) %} {%- if page.extra.toc %} {%- 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 -#} {{}} {#- 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) #} {%- 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[num:current_section_index] %} {{ inner.title }}
{%- endfor %} {#- Shows the current page #} {%- if current_section_index != 0 and current_section_index != (num_pages - 1) %} {{}} {%- endif %} {#- 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[(current_section_index + 1):num] %} {{ inner.title }}
{%- endfor %} {%- if current_section_index < num_pages - 4 %}
{% set _m %}{{}}{% endset %}{{ _m | title }}...
{%- for inner in sorted_array[(current_section_index + 3):(num_pages - 1)] %} {{ inner.title }}
{%- endfor %}
{%- endif %} {%- set last = num_pages - 1 -%} {{}} {#- If there is not more than max pages render normally -#} {%- else %} {%- for inner in tag.pages | sort(attribute="date") %} {{}} {%- endfor %} {%- endif %}
{%- endif %} {%- if toc %}
{{}} {%- for h in toc %}
{{ h.title }}
{%- if h.children %} {%- for h2 in h.children %} {%- endfor %} {%- endif %} {%- endfor %}
{%- endif %} {%- endif %} {%- endif %} {%- endblock toc %} {%- endblock content %} {%- block gotop %} {%- if page.reading_time %} {%- if page.reading_time > 2 %} {%- set icon_top=config.extra.icon_top | default(value="svgs svgh angu") -%} {%- if icon_top %}{%- else %}⋏{%- endif %} {%- endif %} {%- endif %} {%- endblock gotop %}