diff --git a/layout/_layout.swig b/layout/_layout.swig index 5e148adcf6..10ed81f2cb 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -4,10 +4,10 @@ {%- set version = next_env('version') %} {# Language & Config #} -{%- set title = __('title') !== 'title' && __('title') || config.title %} -{%- set subtitle = __('subtitle') !== 'subtitle' && __('subtitle') || config.subtitle %} -{%- set author = __('author') !== 'author' && __('author') || config.author %} -{%- set description = __('description') !== 'description' && __('description') || config.description %} +{%- set title = __('title') !== 'title' and __('title') or config.title %} +{%- set subtitle = __('subtitle') !== 'subtitle' and __('subtitle') or config.subtitle %} +{%- set author = __('author') !== 'author' and __('author') or config.author %} +{%- set description = __('description') !== 'description' and __('description') or config.description %} {%- if theme.pjax %} {%- set pjax = ' pjax' %} @@ -19,7 +19,6 @@ {% include '_partials/head/head-unique.swig' %} {{- next_inject('head') }} {% block title %}{% endblock %} - {{ partial('_third-party/analytics/index.swig', {}, {cache: theme.cache.enable}) }} {{ partial('_scripts/noscript.swig', {}, {cache: theme.cache.enable}) }} @@ -37,7 +36,7 @@
- {%- if theme.scheme === 'Pisces' || theme.scheme === 'Gemini' %} + {%- if theme.scheme === 'Pisces' or theme.scheme === 'Gemini' %} {% include '_partials/header/sub-menu.swig' %} {%- endif %}
diff --git a/layout/_macro/post-collapse.swig b/layout/_macro/post-collapse.swig index 7a028cce67..4b57a9dcae 100644 --- a/layout/_macro/post-collapse.swig +++ b/layout/_macro/post-collapse.swig @@ -1,13 +1,13 @@ {% macro render(posts) %} {%- for post in posts %} - {%- set year %} - {%- set post.year = date(post.date, 'YYYY') %} + {%- set current_year %} + {%- set year = date(post.date, 'YYYY') %} - {%- if post.year !== year %} - {%- set year = post.year %} + {%- if year !== current_year %} + {%- set current_year = year %}
- <{%- if theme.seo %}h2{% else %}h1{%- endif %} class="collection-header">{{ year }} + <{%- if theme.seo %}h2{% else %}h1{%- endif %} class="collection-header">{{ current_year }}
{%- endif %} diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 651ac0b0d5..e777151812 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -17,7 +17,7 @@ {%- if post.header !== false %}
- <{%- if theme.seo %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction &&post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline">{# + <{%- if theme.seo %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction and post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline">{# #}{# Link posts #}{# #}{%- if post.link %} {%- if post.sticky > 0 %} @@ -54,7 +54,7 @@ - {%- if !date_diff && time_diff && theme.post_meta.updated_at.enable && theme.post_meta.updated_at.another_day %} + {%- if not date_diff and time_diff and theme.post_meta.updated_at.enable and theme.post_meta.updated_at.another_day %} {%- set create_title = __('post.created') + __('symbol.colon') + full_date(post.date) + ' / ' + __('post.modified') + __('symbol.colon') + time(post.updated) %} {% else %} {%- set create_title = __('post.created') + __('symbol.colon') + full_date(post.date) %} @@ -66,10 +66,10 @@ {%- endif %} - {%- if theme.post_meta.updated_at.enable && datetime_diff %} - {%- set display_updated = !theme.post_meta.updated_at.another_day || theme.post_meta.updated_at.another_day && date_diff %} + {%- if theme.post_meta.updated_at.enable and datetime_diff %} + {%- set display_updated = not theme.post_meta.updated_at.another_day or theme.post_meta.updated_at.another_day and date_diff %} - {%- if display_updated or !theme.post_meta.created_at %} + {%- if display_updated or not theme.post_meta.created_at %}