diff --git a/overrides/partials/post-list.html b/overrides/partials/post-list.html index f23e00c..873c008 100644 --- a/overrides/partials/post-list.html +++ b/overrides/partials/post-list.html @@ -5,249 +5,253 @@

{{ page.title | d(config.site_name, true) }}

{# description #}

- {{ page.content }} + {{ page.content }}

{% if config.extra['blog_list'] %} - {% set config_pagination = config.extra['blog_list'] %} + {% set config_pagination = config.extra['blog_list'] %} {% else %} - {% set config_pagination = {'pagination': True, 'pagination_message': True, 'pagination_translation': 'posts in'} %} + {% set config_pagination = {'pagination': True, 'pagination_message': True, 'pagination_translation': 'posts in'} %} {% endif %} {# page collection #} {% set valid_pages=[] %} {% for p in pages %} - {% set pg = p.page %} - {% if pg.meta and pg.meta.date %} - {% set date = pg.meta.date | iso_time %} - {% set _ = pg.__setattr__("date", date) %} - {% elif pg.meta.git_creation_date_localized_raw_iso_date %} - {% set date = pg.meta.git_creation_date_localized_raw_iso_date | iso_time %} - {% set _ = pg.__setattr__('date', page.meta.git_creation_date_localized_raw_iso_date) %} - {% else %} - {% set date = build_date_utc | iso_time %} - {% set _ = pg.__setattr__('date', date) %} - {% endif %} - {% set page_category = pg.url | url_decode | replace('/' ~ pg.title ~ '/', '') | lower %} - {% set main_category = page.meta.category | lower %} - {% if main_category in page_category %} - {{ valid_pages.append(pg) or "" }} - {% endif %} + {% set pg = p.page %} + {% if pg.meta and pg.meta.date %} + {% set date = pg.meta.date | iso_time %} + {% set _ = pg.__setattr__("date", date) %} + {% elif page.meta.git_creation_date_localized_raw_iso_date %} + {% set date = page.meta.git_creation_date_localized_raw_iso_date | iso_time %} + {% set _ = pg.__setattr__('date', page.meta.git_creation_date_localized_raw_iso_date) %} + {% else %} + {% set date = build_date_utc | iso_time %} + {% set _ = pg.__setattr__('date', date) %} + {% endif %} + {% set page_category = pg.url | url_decode | replace('/' ~ pg.title ~ '/', '') | lower %} + {% set main_category = page.meta.category | lower %} + {% if main_category in page_category %} + {{ valid_pages.append(pg) or "" }} + {% endif %} {% endfor %} {% set blog_pages=[] %} {% for pg in valid_pages | sort(attribute = 'date', reverse=True) %} - {% set hidden = true if (pg.meta and pg.meta.hidden) %} - {% if (not pg.is_homepage) and - (not pg.markdown == '') and - (not hidden) and not (pg.title == 'index') - %} - {% set datetime = pg.date |time_todatetime %} - {% set dateti=datetime.strftime('%d/%m/%Y') %} - {% set _ = pg.__setattr__('new_date', dateti) %} - {{ blog_pages.append(pg) or "" }} - {% endif %} + {% set hidden = true if (pg.meta and pg.meta.hidden) %} + {% if (not pg.is_homepage) and + (not pg.markdown == '') and + (not hidden) and not (pg.title == 'index') + %} + {% set datetime = pg.date |time_todatetime %} + {% set dateti=datetime.strftime('%d/%m/%Y') %} + {% set _ = pg.__setattr__('new_date', dateti) %} + {{ blog_pages.append(pg) or "" }} + {% endif %} {% endfor %} {% if blog_pages|count > 0 %} - {# count the number of pages #} - {% set page_num = 1 %} - {% if config_pagination['pagination'] %} - {% set page_num = (blog_pages|count / 10)|round(method='ceil')|int %} - {% if config_pagination['pagination_translation'] %} - {% set pagination_translation = config_pagination["pagination_translation"] %} - {% endif %} -
+ {# count the number of pages #} + {% set page_num = 1 %} + {% if config_pagination['pagination'] %} + {% set page_num = (blog_pages|count / 10)|round(method='ceil')|int %} + {% if config_pagination['pagination_translation'] %} + {% set pagination_translation = config_pagination["pagination_translation"] %} + {% endif %} +
-
- -
- {% endif %} - {# pagination #} -
- {% for pg_group in blog_pages|slice(page_num) %} - {% if config_pagination['pagination'] %} -
- {% endif %} - {% for pg in pg_group %} - {% set pg_image = "" %} - {% set pg_category = "" %} - {% set pg_description = "" %} - {% set category_link = "" %} - {% set pg_title = pg.title %} - {% if pg_title == "Index" %} - {% set pg_title = pg.parent.title %} - {% endif %} - {% set main_category = page.meta.category | lower %} - {% if pg.meta %} - {% if pg.meta.title %} - {% set pg_title = pg.meta.title %} - {% endif %} - {% if pg.meta.banner %} - {% set pg_image = pg.meta.banner %} - {% elif pg.meta.image %} - {% set attachmentsFolder = 'attachments' | value_in_frontmatter(config.extra) %} - {% set attachmentsFolder = 'assets/img/' if attachmentsFolder is none else config.extra['attachments'] | regex_replace('/$', '') %} - {% set pg_image = config.site_url ~ attachmentsFolder ~ '/' ~ pg.meta.image %} - {% endif %} - {% if pg.meta.category %} - {% set pg_category = pg.meta.category | lower | replace(main_category, '') | replace('/', '') | title %} - {% if pg_category | length > 1 %} - {% set category_link = config.docs_dir ~ "/" ~ page.meta.category ~ '/' ~ pg_category ~ '/index.md' %} - {% set category_exists = category_link | page_exists %} - {% if category_exists %} - {% set link = pg.meta.category %} - {% set link = config.site_url ~ link ~ '/' %} - {% set pg_category = '' ~ pg_category ~ '' %} - {% endif %} - {% endif %} - {% endif %} - {% if pg.meta.description %} - {% set pg_description = pg.meta.description | truncate(200)%} - {% endif %} - {% endif %} -
-

- {{ pg_title }} -

- -
- {% endfor %} -
- {% endfor %} -
+
+ +
+ {% endif %} + {# pagination #} +
+ {% for pg_group in blog_pages|slice(page_num) %} + {% if config_pagination['pagination'] %} +
+ {% endif %} + {% for pg in pg_group %} + {% set pg_image = "" %} + {% set pg_category = "" %} + {% set pg_description = "" %} + {% set category_link = "" %} + {% set pg_title = pg.title %} + {% if pg_title == "Index" %} + {% set pg_title = pg.parent.title %} + {% endif %} + {% set main_category = page.meta.category | lower %} + {% if pg.meta %} + {% if pg.meta.title %} + {% set pg_title = pg.meta.title %} + {% endif %} + {% if pg.meta.banner %} + {% set pg_image = pg.meta.banner %} + {% elif pg.meta.image %} + {% set attachmentsFolder = 'attachments' | value_in_frontmatter(config.extra) %} + {% set attachmentsFolder = 'assets/img/' if attachmentsFolder is none else config.extra['attachments'] | regex_replace('/$', '') %} + {% set pg_image = config.site_url ~ attachmentsFolder ~ '/' ~ pg.meta.image %} + {% endif %} + {% if pg.meta.category %} + {% set pg_category = pg.meta.category | lower | replace(main_category, '') | replace('/', '') | title %} + {% if pg_category | length > 1 %} + {% set category_link = config.docs_dir ~ "/" ~ page.meta.category ~ '/' ~ pg_category ~ '/index.md' %} + {% set category_exists = category_link | page_exists %} + {% if category_exists %} + {% set link = pg.meta.category %} + {% set link = config.site_url ~ link ~ '/' %} + {% set pg_category = '' ~ pg_category ~ '' %} + {% endif %} + {% endif %} + {% endif %} + {% if pg.meta.description %} + {% set pg_description = pg.meta.description | truncate(200)%} + {% endif %} + {% endif %} +
+

+ {{ pg_title }} +

+ +
+ {% endfor %} +
+ {% endfor %} +
- {% if config_pagination['pagination'] %} -
- -
- {% endif %} + {% if config_pagination["pagination"] and config_pagination["pagination_message"] %} +

Total : {{ blog_pages|count }} {{ pagination_translation }} {{ page_num }} pages.

+ {% endif %} - {% if config_pagination["pagination"] and config_pagination["pagination_message"] %} -

Total : {{ blog_pages|count }} {{ pagination_translation }} {{ page_num }} pages.

- {% endif %} + + {% if config_pagination['pagination'] %} + - {% endif %} + window.location.hash = "#page1"; + } + + {% endif %} {% else %} - -

- {% set no_page_found = 'no_page_found' | value_in_frontmatter(config.extra['blog_list']) %} - {% set no_page_found = 'No pages found!' if no_page_found is none else config.extra['blog_list']['no_page_found'] %} - {{ no_page_found }} -

+ +

+ {% set no_page_found = 'no_page_found' | value_in_frontmatter(config.extra['blog_list']) %} + {% set no_page_found = 'No pages found!' if no_page_found is none else config.extra['blog_list']['no_page_found'] %} + {{ no_page_found }} +

{% endif %} \ No newline at end of file