From 974141abd6d04d090f9f914e955d8e3c69aff3a6 Mon Sep 17 00:00:00 2001 From: ppoffice Date: Thu, 7 Jul 2016 21:44:52 +0800 Subject: [PATCH] chore: remove implict thumbnail declaration --- scripts/thumbnail.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/scripts/thumbnail.js b/scripts/thumbnail.js index e71ae99..d69f6ee 100644 --- a/scripts/thumbnail.js +++ b/scripts/thumbnail.js @@ -5,26 +5,5 @@ * <%- thumbnail(post) %> */ hexo.extend.helper.register('thumbnail', function (post) { - var url = post.thumbnail || post.banner || ''; - if (!url) { - var imgPattern = /\/ig; - var result = imgPattern.exec(post.content); - if (result && result.length > 1) { - url = result[1]; - } - if(url.length > 0) { - var pattern = /^[\\{0,1}\/{0,1}]([^\/^\\]+)/, - pattern_ = /([^\/^\\]+)/; - if ((ret = pattern.exec(url)) != null) { - if(ret[0].length == url.length) { - url = post.path + ret[1]; - } - } else if ((ret = pattern_.exec(url)) != null) { - if(ret[0].length == url.length) { - url = post.path + ret[1]; - } - } - } - } - return url; + return post.thumbnail || post.banner || ''; }); \ No newline at end of file