From 250181c569a3da1fa0e6423c1f362b5b83d3620b Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Tue, 28 Apr 2020 15:31:14 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9=E7=95=B6=E5=8D=9A?= =?UTF-8?q?=E5=AE=A2root=E4=B8=8D=E6=98=AF'/'=E6=99=82,=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=9C=96=E7=89=87=E6=9C=83=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=87=BA=E7=9A=84bug=20close=20#211?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++++- README_CN.md | 7 +++++++ layout/404.pug | 2 +- layout/flink.pug | 6 +++--- layout/includes/header/index.pug | 2 +- layout/includes/mixins/article-sort.pug | 2 +- layout/includes/mixins/post-ui.pug | 4 ++-- layout/includes/pagination.pug | 8 ++++---- layout/includes/share/share-js.pug | 2 +- layout/includes/widget/card_recent_post.pug | 4 ++-- 10 files changed, 31 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index fdcdc58..0da0b28 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,15 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Bu ## Documentation -Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW` +Find in [hexo-theme-butterfly docs](https://docs.jerryc.me) and [JerryC](https://jerryc.me/posts/21cfbf15). it supports `zh-TW` and `zh-CN` + +You can also join the Chat Group. + +[ 💬 Join QQ Group [recommend]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb) + +[ 💬 Join Telegram Group](https://t.me/hexo_butterfly) + + ## Screenshots diff --git a/README_CN.md b/README_CN.md index 2357f7e..d36ea4d 100644 --- a/README_CN.md +++ b/README_CN.md @@ -36,7 +36,14 @@ theme: Butterfly 可查看[hexo-theme-butterfly docs](https://docs.jerryc.me) 和 [JerryC](https://jerryc.me/posts/21cfbf15) +你也可以加入群組 + +[ 💬 QQ群 [推薦]](https://jq.qq.com/?_wv=1027&k=5KI3Jqb) + +[ 💬Telegram群](https://t.me/hexo_butterfly) + ## 截圖 + ![image](https://user-images.githubusercontent.com/16351105/58887365-1272f780-8718-11e9-9329-3292c6ba20d4.png) ![image](https://user-images.githubusercontent.com/16351105/58887457-3cc4b500-8718-11e9-9417-2bdea603c92e.png) diff --git a/layout/404.pug b/layout/404.pug index b6c2d8c..a088390 100644 --- a/layout/404.pug +++ b/layout/404.pug @@ -1,5 +1,5 @@ - var top_img = theme.error_404.background || theme.default_top_img -- var bg_img = `background-image: url(${top_img})` +- var bg_img = `background-image: url(${url_for(top_img)})` doctype html html(lang=config.language data-theme=theme.display_mode) diff --git a/layout/flink.pug b/layout/flink.pug index d443ea3..254293b 100644 --- a/layout/flink.pug +++ b/layout/flink.pug @@ -7,11 +7,11 @@ .md-links each item in i.link_list .md-links-item - a(href=item.link title=item.name target="_blank") + a(href=url_for(item.link) title=item.name target="_blank") if theme.lazyload.enable - img.lazyload(data-src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) + img.lazyload(data-src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) else - img(src=item.avatar onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) + img(src=url_for(item.avatar) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt=item.name ) .md-links-title= item.name .md-links-des= item.descr != page.content diff --git a/layout/includes/header/index.pug b/layout/includes/header/index.pug index 2c6ede4..b728808 100644 --- a/layout/includes/header/index.pug +++ b/layout/includes/header/index.pug @@ -19,7 +19,7 @@ if theme.douban else if is_current('/games/', [strict]) - var top_img = theme.douban.games_img || theme.default_top_img -- var bg_img = top_img && top_img !== true ? `background-image: url(${top_img})` : '' +- var bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : '' - var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title - var isHomeClass = is_home() ? 'full_page' : 'not-index-bg' - is_post() ? isHomeClass = 'post-bg' : isHomeClass diff --git a/layout/includes/mixins/article-sort.pug b/layout/includes/mixins/article-sort.pug index 53dd896..d0a793b 100644 --- a/layout/includes/mixins/article-sort.pug +++ b/layout/includes/mixins/article-sort.pug @@ -11,7 +11,7 @@ mixin articleSort(posts) if article.cover && theme.cover.archives_enable .article-sort-img a.article-sort-item__img(href=url_for(article.path)) - img(src=`${article.cover}` alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`) + img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`) .article-sort-post a.article-sort-item__post(href=url_for(article.path)) i.fa.fa-clock-o(aria-hidden="true") diff --git a/layout/includes/mixins/post-ui.pug b/layout/includes/mixins/post-ui.pug index 4cca5ce..2814a68 100644 --- a/layout/includes/mixins/post-ui.pug +++ b/layout/includes/mixins/post-ui.pug @@ -10,9 +10,9 @@ mixin postUI(posts) .post_cover(class=leftOrRight) a(href=url_for(link) title=title) if theme.lazyload.enable - img.post_bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) + img.post_bg.lazyload(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) else - img.post_bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) + img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title) .recent-post-info(class=no_cover) a.article-title(href=url_for(link) title=title)= title .article-meta-wrap diff --git a/layout/includes/pagination.pug b/layout/includes/pagination.pug index 33bf9ae..0ca84be 100644 --- a/layout/includes/pagination.pug +++ b/layout/includes/pagination.pug @@ -18,9 +18,9 @@ else - var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover a(href=url_for(page.prev.path)) if theme.lazyload.enable - img.prev_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` ) + img.prev_cover.lazyload(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` ) else - img.prev_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` ) + img.prev_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` ) .pagination-info .label=_p('pagination.prev') .prev_info=page.prev.title @@ -31,9 +31,9 @@ else .next-post(class=hasPagePrev) a(href=url_for(page.next.path)) if theme.lazyload.enable - img.next_cover.lazyload(data-src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) + img.next_cover.lazyload(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`) else - img.next_cover(src=`${pagination_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'`) + img.next_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`) .pagination-info .label=_p('pagination.next') .next_info=page.next.title \ No newline at end of file diff --git a/layout/includes/share/share-js.pug b/layout/includes/share/share-js.pug index ec12a88..85f84dd 100644 --- a/layout/includes/share/share-js.pug +++ b/layout/includes/share/share-js.pug @@ -1,4 +1,4 @@ if (theme.sharejs && theme.sharejs.enable) - .social-share(data-image= page.cover|| theme.avatar.img data-sites= theme.sharejs.sites) + .social-share(data-image=url_for(page.cover|| theme.avatar.img) data-sites= theme.sharejs.sites) link(rel="stylesheet" href=url_for(theme.CDN.sharejs_css)) script(src=url_for(theme.CDN.sharejs)) \ No newline at end of file diff --git a/layout/includes/widget/card_recent_post.pug b/layout/includes/widget/card_recent_post.pug index 29a1ddf..ead0954 100644 --- a/layout/includes/widget/card_recent_post.pug +++ b/layout/includes/widget/card_recent_post.pug @@ -16,9 +16,9 @@ if post_cover && theme.cover.aside_enable .aside-post-cover if theme.lazyload.enable - img.aside-post-bg.lazyload(data-src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title) + img.aside-post-bg.lazyload(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title) else - img.aside-post-bg(src=`${post_cover}` onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title) + img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title) .aside-post-title(class=no_cover) .aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title') time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]