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 %} 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 @@ + diff --git a/scripts/tags/exturl.js b/scripts/tags/exturl.js index 500447719..f79952278 100644 --- a/scripts/tags/exturl.js +++ b/scripts/tags/exturl.js @@ -4,8 +4,11 @@ 'use strict'; -var util = require('hexo-util'); +/*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); var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/; 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');