From c758847714cf2a80461cbe8ffacb8f8d4749a713 Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Mon, 14 May 2018 09:41:21 +0300 Subject: [PATCH] Added custom language support feature. (#253) * Added custom language support feature. * Fix `hexo` variables in linter by adding `global hexo` comment. * Check Stickler CI. * Error: lines-around-comment * Fix error: lines-around-comment --- layout/_layout.swig | 6 ++++ layout/_macro/post-copyright.swig | 2 +- layout/_macro/post.swig | 9 ++++-- layout/_macro/reward.swig | 6 ++-- layout/_macro/sidebar.swig | 6 ++-- layout/_macro/wechat-subscriber.swig | 2 +- layout/_partials/footer.swig | 2 +- layout/_partials/head/head-unique.swig | 2 +- layout/_partials/header/brand.swig | 10 ++++--- layout/_partials/header/index.swig | 1 - layout/_third-party/comments/disqus.swig | 5 +++- layout/archive.swig | 2 +- layout/category.swig | 2 +- layout/index.swig | 2 +- layout/page.swig | 2 +- layout/post.swig | 2 +- layout/schedule.swig | 2 +- layout/tag.swig | 2 +- scripts/merge-configs.js | 36 ++++++++++++++++++------ 19 files changed, 66 insertions(+), 35 deletions(-) diff --git a/layout/_layout.swig b/layout/_layout.swig index 709e0f40dd..23019f2fab 100644 --- a/layout/_layout.swig +++ b/layout/_layout.swig @@ -3,6 +3,12 @@ {# NexT 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 html_class = 'theme-next ' + theme.scheme %} {% if theme.motion.enable %} {% set html_class = html_class + ' use-motion' %} diff --git a/layout/_macro/post-copyright.swig b/layout/_macro/post-copyright.swig index 4d79832802..50ce4a2a10 100644 --- a/layout/_macro/post-copyright.swig +++ b/layout/_macro/post-copyright.swig @@ -1,7 +1,7 @@