{%- macro title(page) %}

{{ page.title }}

{{ page.date | date(format="%B %d, %Y") }} {%- if page.taxonomies.authors and config.taxonomies %} by {%- for author in page.taxonomies.authors %} {%- if author_flag %} and {% endif %} {{ author }} {%- set_global author_flag = true %} {%- endfor %} {%- elif config.extra.author and config.extra.author_show %} by {{ config.extra.author }} {%- endif %} {%- if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- if config.extra.readtime %} - {{ page.reading_time }} {{ config.extra.readtime_string | default(value="min") }} {% endif %} {%- endmacro title %} {%- macro footer(page) %}

Back to top

{%- endmacro footer %} {%- macro pagination(paginator)%} {%- 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 %}