From a6ea914fa26d6e82e6f0fb9e4da63a6b18ebd0a6 Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sun, 12 Mar 2017 16:41:35 +0300 Subject: [PATCH 1/5] Bug: Remove redundant symbols. [2] #1494 --- layout/_macro/post.swig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 550faf592..a7edc1bfb 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -215,7 +215,7 @@ {% if theme.post_wordcount.item_text %} {{ __('post.min2read') }} {% endif %} - + {{ min2read(post.content) }} {% endif %} From c8ee8454777462e28217e93ec51c9a45b71be6ce Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sun, 12 Mar 2017 17:13:40 +0300 Subject: [PATCH 2/5] FIX: not found `hexo-util` with base hexo install. Issue: #1490 Pull: #1438. --- scripts/tags/exturl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tags/exturl.js b/scripts/tags/exturl.js index 500447719..8f348c514 100644 --- a/scripts/tags/exturl.js +++ b/scripts/tags/exturl.js @@ -4,8 +4,9 @@ 'use strict'; -var util = require('hexo-util'); +var util = require(hexo.base_dir + 'node_modules/hexo/node_modules/hexo-util'); var htmlTag = util.htmlTag; +//console.log(util); var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/; From 6d82ed91486276a96c335cc201a5bcf25f9a8edc Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sun, 12 Mar 2017 17:21:38 +0300 Subject: [PATCH 3/5] ADD: jshint camelcase. --- scripts/tags/exturl.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tags/exturl.js b/scripts/tags/exturl.js index 8f348c514..f79952278 100644 --- a/scripts/tags/exturl.js +++ b/scripts/tags/exturl.js @@ -4,7 +4,9 @@ 'use strict'; +/*jshint camelcase: false */ var util = require(hexo.base_dir + 'node_modules/hexo/node_modules/hexo-util'); +/*jshint camelcase: true */ var htmlTag = util.htmlTag; //console.log(util); From edf980382e0af29132a2b4e26dcfff5a2e5b4b2d Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sun, 12 Mar 2017 18:10:21 +0300 Subject: [PATCH 4/5] ADD: open link js file loading when `exturl: true` --- layout/_scripts/third-party/exturl.swig | 1 + 1 file changed, 1 insertion(+) create mode 100644 layout/_scripts/third-party/exturl.swig diff --git a/layout/_scripts/third-party/exturl.swig b/layout/_scripts/third-party/exturl.swig new file mode 100644 index 000000000..fa1e91725 --- /dev/null +++ b/layout/_scripts/third-party/exturl.swig @@ -0,0 +1 @@ + From d023b1ddea0cc3de68cdbeb829b2cf4ce0c8780f Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sun, 12 Mar 2017 18:45:17 +0300 Subject: [PATCH 5/5] FIX: loading `exturl` css only if true in config. --- source/css/_common/components/tags/tags.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/css/_common/components/tags/tags.styl b/source/css/_common/components/tags/tags.styl index 7223759f5..5ebd09116 100644 --- a/source/css/_common/components/tags/tags.styl +++ b/source/css/_common/components/tags/tags.styl @@ -2,4 +2,4 @@ @import "blockquote-center"; @import "group-pictures"; @import "note"; -@import "exturl"; +@import "exturl" if hexo-config('exturl');