From b63c60fccf43861b6900c71479af96a468b996e6 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Tue, 25 Aug 2020 02:04:54 +0800 Subject: [PATCH] Fix post-meta --- .github/label-commenter-config.yml | 3 +- layout/_macro/post.njk | 107 +---------------- layout/_partials/post/post-meta.njk | 109 ++++++++++++++++++ .../_common/components/pages/breadcrumb.styl | 4 +- .../_common/components/post/post-header.styl | 2 +- 5 files changed, 115 insertions(+), 110 deletions(-) create mode 100644 layout/_partials/post/post-meta.njk diff --git a/.github/label-commenter-config.yml b/.github/label-commenter-config.yml index 9b2ca4b..2e83d50 100644 --- a/.github/label-commenter-config.yml +++ b/.github/label-commenter-config.yml @@ -15,7 +15,8 @@ labels: - name: 🎯 Roadmap labeled: issue: - body: This issue has been added to the latest roadmap. + body: | + This issue has been added to the latest roadmap. :tada: - name: Support labeled: issue: diff --git a/layout/_macro/post.njk b/layout/_macro/post.njk index a232b1c..12a2fdb 100644 --- a/layout/_macro/post.njk +++ b/layout/_macro/post.njk @@ -44,112 +44,7 @@
-
- {%- set date_diff = date(post.date) != date(post.updated) %} - {%- set time_diff = time(post.date) != time(post.updated) %} - - {%- if theme.post_meta.created_at %} - - {%- endif %} - - {%- if theme.post_meta.updated_at.enable %} - {%- if not theme.post_meta.updated_at.another_day or date_diff or not theme.post_meta.created_at %} - - {%- endif %} - {%- endif %} - - {%- if post.categories and post.categories.length and theme.post_meta.categories %} - - {%- endif %} - - {# LeanCloud PageView #} - {%- if theme.leancloud_visitors.enable or (theme.valine.enable and theme.valine.visitor) %} - - {%- endif %} - - {%- if theme.firestore.enable %} - - {%- endif %} - - {%- if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.post_views %} - - {%- endif %} - - {{- next_inject('postMeta') }} - - {%- if config.symbols_count_time.symbols %} - {%- if theme.symbols_count_time.separated_meta %}
{%- endif %} - - {%- endif %} - - {%- if config.symbols_count_time.time %} - - {%- endif %} -
+ {{ partial('_partials/post/post-meta.njk') }} {%- if post.description and (not theme.excerpt_description or not is_index) %}
{{ post.description }}
diff --git a/layout/_partials/post/post-meta.njk b/layout/_partials/post/post-meta.njk new file mode 100644 index 0000000..73f8401 --- /dev/null +++ b/layout/_partials/post/post-meta.njk @@ -0,0 +1,109 @@ +
+ {%- set date_diff = date(post.date) != date(post.updated) %} + {%- set time_diff = time(post.date) != time(post.updated) %} + + {%- if theme.post_meta.created_at %} + + {%- endif %} + + {%- if theme.post_meta.updated_at.enable %} + {%- if not theme.post_meta.updated_at.another_day or date_diff or not theme.post_meta.created_at %} + + {%- endif %} + {%- endif %} + + {%- if post.categories and post.categories.length and theme.post_meta.categories %} + + {%- endif %} + + {# LeanCloud PageView #} + {%- if theme.leancloud_visitors.enable or (theme.valine.enable and theme.valine.visitor) %} + + {%- endif %} + + {%- if theme.firestore.enable %} + + {%- endif %} + + {%- if not is_index and theme.busuanzi_count.enable and theme.busuanzi_count.post_views %} + + {%- endif %} + + {{- next_inject('postMeta') }} + + {%- if config.symbols_count_time.symbols %} + {%- if theme.symbols_count_time.separated_meta %} +
+
+ {%- endif %} + + {%- endif %} + + {%- if config.symbols_count_time.time %} + + {%- endif %} +
diff --git a/source/css/_common/components/pages/breadcrumb.styl b/source/css/_common/components/pages/breadcrumb.styl index be787ba..c0b6f7a 100644 --- a/source/css/_common/components/pages/breadcrumb.styl +++ b/source/css/_common/components/pages/breadcrumb.styl @@ -9,13 +9,13 @@ ul.breadcrumb { display: inline; } - li + li::before { + li:not(:first-child)::before { content: '/\00a0'; font-weight: normal; padding: .5em; } - li + li:last-child { + li:last-child { font-weight: bold; } } diff --git a/source/css/_common/components/post/post-header.styl b/source/css/_common/components/post/post-header.styl index d2a88fb..24d6562 100644 --- a/source/css/_common/components/post/post-header.styl +++ b/source/css/_common/components/post/post-header.styl @@ -89,7 +89,7 @@ } // .post-meta-item exists in .post-meta and footer -.post-meta-item + .post-meta-item::before { +.post-meta-item:not(:first-child)::before { content: '|'; margin: 0 .5em; }