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 %}