- {{ pg_title }} -
-- {{ pg_description }} -
-- - {% include ".icons/material/calendar.svg" %} - - - {{ pg.new_date }} - - {% if pg_category | length > 1 %} - - - {% include ".icons/material/folder.svg" %} - - {{ pg_category }} - - {% endif %} -
-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.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 %} + -- {{ pg_description }} -
-- - {% include ".icons/material/calendar.svg" %} - - - {{ pg.new_date }} - - {% if pg_category | length > 1 %} - - - {% include ".icons/material/folder.svg" %} - - {{ pg_category }} - - {% endif %} -
-+ {{ pg_description }} +
++ + {% include ".icons/material/calendar.svg" %} + + + {{ pg.new_date }} + + {% if pg_category | length > 1 %} + + + {% include ".icons/material/folder.svg" %} + + {{ pg_category }} + + {% endif %} +
+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