From 99056cb6b8cc8485613c15fb4ee659e971847303 Mon Sep 17 00:00:00 2001 From: StevenJoeZhang <1119186082@qq.com> Date: Mon, 5 Aug 2019 23:20:42 +0800 Subject: [PATCH 1/9] Replace && / || with and / or --- layout/_layout.swig | 12 ++++++------ layout/_macro/post.swig | 12 ++++++------ layout/_partials/footer.swig | 2 +- layout/_partials/header/index.swig | 4 ++-- layout/_partials/header/sub-menu.swig | 2 +- layout/_partials/post/post-copyright.swig | 4 ++-- layout/_partials/post/post-related.swig | 4 ++-- layout/_third-party/comments/changyan.swig | 2 +- layout/page.swig | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/layout/_layout.swig b/layout/_layout.swig index ba5f79e10b..f18a936d2e 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' %} @@ -30,7 +30,7 @@ {{ partial('_scripts/noscript.swig', {}, {cache: theme.cache.enable}) }} - + {%- set container_class = 'container' %} {%- if theme.sidebar.position %} @@ -49,7 +49,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.swig b/layout/_macro/post.swig index 106bc89200..0bee0592d6 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -8,7 +8,7 @@ {%- set post_class = post_class + ' post-sticky' %} {%- endif %} - {%- if theme.reading_progress.enable && not is_index %} + {%- if theme.reading_progress.enable and not is_index %}
{%- endif %} @@ -34,7 +34,7 @@ {# Not to show title for quote posts that do not have a title #} {%- if not (is_index and post.type === 'quote' and not post.title) %} - <{%- 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 %} @@ -72,7 +72,7 @@ - {%- if !date_diff && time_diff && theme.post_meta.updated_at.enable && theme.post_meta.updated_at.another_day %} + {%- if !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) %} @@ -84,8 +84,8 @@ {%- 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 = !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 %}