From 87b13472a6bc51c983400c4b4dbf0d7de2114878 Mon Sep 17 00:00:00 2001 From: StevenJoeZhang <1119186082@qq.com> Date: Fri, 16 Aug 2019 02:34:57 +0800 Subject: [PATCH 1/2] Remove post type quote & picture --- layout/_macro/post-collapse.swig | 8 +-- layout/_macro/post.swig | 63 ++++++++----------- .../_common/components/post/post-type.styl | 12 ---- source/css/_common/components/post/post.styl | 1 - 4 files changed, 27 insertions(+), 57 deletions(-) delete mode 100644 source/css/_common/components/post/post-type.styl diff --git a/layout/_macro/post-collapse.swig b/layout/_macro/post-collapse.swig index 7fca6ff606..af931d67aa 100644 --- a/layout/_macro/post-collapse.swig +++ b/layout/_macro/post-collapse.swig @@ -13,7 +13,7 @@ {%- endif %} {# endshow #} -
+
<{%- if theme.seo %}h3{% else %}h2{%- endif %} class="post-title"> @@ -23,11 +23,7 @@ {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }} {% else %} {%- endif %} diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index cb8b4fc252..4fbf9eadbb 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -1,9 +1,4 @@ - {%- set headlessPost = Array.prototype.indexOf.call(['quote', 'picture'], post.type) > -1 %} - - {%- set post_class = 'post post-type-' + post.type | default('normal') %} - {%- if post_extra_class > 0 %} - {%- set post_class = post_class + ' ' + post_extra_class | default('') %} - {%- endif %} + {%- set post_class = 'post' %} {%- if post.sticky > 0 %} {%- set post_class = post_class + ' post-sticky' %} {%- endif %} @@ -29,35 +24,31 @@ - {%- if not headlessPost %} + {%- if post.header !== 'none' and not (is_index and post.header === 'post') %}
- - {# 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">{# - #}{# Link posts #}{# - #}{%- if post.link %} - {%- if post.sticky > 0 %} - - - - {%- endif %} - {%- set postTitleIcon = '' %} - {%- set postText = post.title or post.link %} - {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }} - {% elif is_index %} - {%- if post.sticky > 0 %} - - - - {%- endif %} - {{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: 'url' }) }} - {% else -%} - {{- post.title -}} - {% include '../_partials/post-edit.swig' %} + <{%- if theme.seo %}h2{% else %}h1{%- endif %} class="post-title{%- if post.direction &&post.direction.toLowerCase() === 'rtl' %} rtl{%- endif %}" itemprop="name headline">{# + #}{# Link posts #}{# + #}{%- if post.link %} + {%- if post.sticky > 0 %} + + + {%- endif %} - - {%- endif %} + {%- set postTitleIcon = '' %} + {%- set postText = post.title or post.link %} + {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }} + {% elif is_index %} + {%- if post.sticky > 0 %} + + + + {%- endif %} + {{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: 'url' }) }} + {% else -%} + {{- post.title -}} + {% include '../_partials/post-edit.swig' %} + {%- endif %} +