From e16670fd348e94351f1c6fc768b476db337741c0 Mon Sep 17 00:00:00 2001 From: StevenJoeZhang <1119186082@qq.com> Date: Mon, 29 Jul 2019 16:16:07 +0800 Subject: [PATCH] Update --- layout/_layout.swig | 52 +-- layout/_macro/menu/menu-badge.swig | 10 +- layout/_macro/menu/menu-item.swig | 22 +- layout/_macro/post-collapse.swig | 16 +- layout/_macro/post.swig | 300 +++++++++--------- layout/_macro/sidebar.swig | 40 +-- .../_partials/analytics/busuanzi-counter.swig | 16 +- .../_partials/analytics/cnzz-analytics.swig | 4 +- .../analytics/tencent-analytics.swig | 4 +- layout/_partials/analytics/tencent-mta.swig | 4 +- layout/_partials/comments.swig | 14 +- layout/_partials/footer.swig | 42 +-- layout/_partials/github-banner.swig | 10 +- layout/_partials/head/head-unique.swig | 18 +- layout/_partials/head/head.swig | 112 +++---- layout/_partials/header/brand.swig | 18 +- layout/_partials/header/index.swig | 4 +- layout/_partials/header/menu.swig | 44 +-- layout/_partials/header/sub-menu.swig | 118 +++---- layout/_partials/page/breadcrumb.swig | 38 +-- layout/_partials/page/page-header.swig | 8 +- layout/_partials/pagination.swig | 4 +- layout/_partials/post-edit.swig | 4 +- layout/_partials/post/post-copyright.swig | 20 +- layout/_partials/post/post-related.swig | 22 +- layout/_partials/post/reward.swig | 14 +- layout/_partials/search/index.swig | 4 +- layout/_partials/share/index.swig | 8 +- layout/_partials/share/likely.swig | 20 +- layout/_partials/share/needsharebutton.swig | 28 +- layout/_partials/sidebar/site-overview.swig | 134 ++++---- layout/_scripts/commons.swig | 4 +- layout/_scripts/exturl.swig | 4 +- layout/_scripts/schemes/muse.swig | 4 +- layout/_scripts/schemes/pisces.swig | 4 +- layout/_scripts/scroll-cookie.swig | 4 +- layout/_scripts/three.swig | 30 +- layout/_scripts/vendors.swig | 120 +++---- .../analytics/application-insights.swig | 4 +- .../analytics/baidu-analytics.swig | 4 +- layout/_third-party/analytics/firestore.swig | 10 +- .../analytics/google-analytics.swig | 4 +- layout/_third-party/analytics/growingio.swig | 4 +- .../analytics/lean-analytics.swig | 24 +- layout/_third-party/baidu-push.swig | 4 +- layout/_third-party/bookmark.swig | 16 +- layout/_third-party/chat/chatra.swig | 8 +- layout/_third-party/chat/tidio.swig | 4 +- layout/_third-party/comments/changyan.swig | 4 +- layout/_third-party/comments/disqus.swig | 14 +- layout/_third-party/comments/disqusjs.swig | 20 +- layout/_third-party/comments/gitalk.swig | 32 +- layout/_third-party/comments/livere.swig | 12 +- layout/_third-party/comments/valine.swig | 8 +- layout/_third-party/facebook-sdk.swig | 4 +- layout/_third-party/math/index.swig | 28 +- layout/_third-party/math/katex.swig | 12 +- layout/_third-party/math/mathjax.swig | 8 +- layout/_third-party/quicklink.swig | 44 +-- layout/_third-party/rating.swig | 4 +- layout/_third-party/schedule.swig | 4 +- .../_third-party/search/algolia-search.swig | 16 +- layout/_third-party/search/index.swig | 4 +- layout/_third-party/tags/mermaid.swig | 4 +- layout/_third-party/tags/pdf.swig | 4 +- layout/_third-party/vkontakte-api.swig | 12 +- layout/archive.swig | 38 +-- layout/category.swig | 8 +- layout/index.swig | 8 +- layout/page.swig | 40 +-- layout/tag.swig | 8 +- 71 files changed, 870 insertions(+), 870 deletions(-) diff --git a/layout/_layout.swig b/layout/_layout.swig index 2881909270..26e03e0044 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -1,26 +1,26 @@ {# NexT version #} -{% set version = next_env('version') %} +{%- 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' && __('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 html_class = 'theme-next ' + theme.scheme %} -{% if theme.motion.enable %} - {% set html_class = html_class + ' use-motion' %} -{% endif %} +{%- set html_class = 'theme-next ' + theme.scheme %} +{%- if theme.motion.enable %} + {%- set html_class = html_class + ' use-motion' %} +{%- endif %} {{ partial('_partials/head/head.swig', {}, {cache: theme.cache.enable}) }} {% include '_partials/head/head-unique.swig' %} - {% for inject_item in theme.injects.head %} + {%- for inject_item in theme.injects.head %} {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} - {% endfor %} + {%- endfor %} {% block title %}{% endblock %} {% include '_third-party/analytics/index.swig' %} {{ partial('_scripts/noscript.swig', {}, {cache: theme.cache.enable}) }} @@ -28,10 +28,10 @@ - {% set container_class = 'container' %} - {% if theme.sidebar.position %} - {% set container_class = container_class + ' sidebar-position-' + theme.sidebar.position %} - {% endif %} + {%- set container_class = 'container' %} + {%- if theme.sidebar.position %} + {%- set container_class = container_class + ' sidebar-position-' + theme.sidebar.position %} + {%- endif %}
@@ -45,17 +45,17 @@
- {% if theme.scheme === 'Pisces' || theme.scheme === 'Gemini' %} + {%- if theme.scheme === 'Pisces' || theme.scheme === 'Gemini' %} {% include '_partials/header/sub-menu.swig' %} - {% endif %} + {%- endif %}
{% block content %}{% endblock %}
{% include '_partials/comments.swig' %}
- {% if theme.sidebar.display !== 'remove' %} + {%- if theme.sidebar.display !== 'remove' %} {% block sidebar %}{% endblock %} - {% endif %} + {%- endif %}
@@ -67,14 +67,14 @@
- {% if theme.back2top.enable and not theme.back2top.sidebar %} + {%- if theme.back2top.enable and not theme.back2top.sidebar %}
- {% if theme.back2top.scrollpercent %} + {%- if theme.back2top.scrollpercent %} 0% - {% endif %} + {%- endif %}
- {% endif %} + {%- endif %} {% include '_partials/share/index.swig' %} @@ -82,7 +82,7 @@ {% include '_scripts/vendors.swig' %} {% include '_scripts/commons.swig' %} - {% set scheme_script = '_scripts/schemes/' + theme.scheme | lower + '.swig' %} + {%- set scheme_script = '_scripts/schemes/' + theme.scheme | lower + '.swig' %} {% include scheme_script %} {% block script_extra %}{% endblock %} @@ -94,9 +94,9 @@ {% include '_third-party/index.swig' %} - {% for inject_item in theme.injects.bodyEnd %} + {%- for inject_item in theme.injects.bodyEnd %} {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} - {% endfor %} + {%- endfor %} diff --git a/layout/_macro/menu/menu-badge.swig b/layout/_macro/menu/menu-badge.swig index b2dcce135d..bb44a31a6e 100644 --- a/layout/_macro/menu/menu-badge.swig +++ b/layout/_macro/menu/menu-badge.swig @@ -1,14 +1,14 @@ {% macro render(name) %} - {% set badges = { + {%- set badges = { archives: site.posts.length, categories: site.categories.length, tags: site.tags.length } %} - {% for menu, count in badges %} - {% if name == menu %} + {%- for menu, count in badges %} + {%- if name == menu %} {{ count }} - {% endif %} - {% endfor %} + {%- endif %} + {%- endfor %} {% endmacro %} diff --git a/layout/_macro/menu/menu-item.swig b/layout/_macro/menu/menu-item.swig index 0dca585233..734f1f5efe 100644 --- a/layout/_macro/menu/menu-item.swig +++ b/layout/_macro/menu/menu-item.swig @@ -1,20 +1,20 @@ {% macro render(name, value) %} {% import 'menu-badge.swig' as menu_badge %} - {% set itemURL = value.split('||')[0] | trim %} - {% if itemURL.indexOf('http') != 0 %} - {% set itemURL = itemURL | replace('//', '/', 'g') %} - {% endif %} + {%- set itemURL = value.split('||')[0] | trim %} + {%- if itemURL.indexOf('http') != 0 %} + {%- set itemURL = itemURL | replace('//', '/', 'g') %} + {%- endif %}