From d33dc5551ce8899408ad8738df43deb57c0490cb Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 17 Jan 2021 19:17:34 +0800 Subject: [PATCH] =?UTF-8?q?remove:=20=E5=88=AA=E9=99=A4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=A4=9A=E9=A4=98=E7=9A=84=E4=BB=A3=E7=A2=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 7 +++---- layout/includes/header/index.pug | 5 +---- layout/includes/header/post-info.pug | 2 +- package.json | 2 +- scripts/helpers/page.js | 6 ------ source/css/_layout/head.styl | 9 +++------ 6 files changed, 9 insertions(+), 22 deletions(-) diff --git a/_config.yml b/_config.yml index b97c9f2..768646d 100644 --- a/_config.yml +++ b/_config.yml @@ -194,15 +194,14 @@ reward: # - img: /img/alipay.jpg # link: # text: alipay - + # Post edit # Easily browse and edit blog source code online. post_edit: enable: false - # Link for view source - # url: https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name/ - # Link for fork & edit # url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name/ + # For example: https://github.com/jerryc127/butterfly.js.org/edit/main/source/ + url: # Related Articles related_post: diff --git a/layout/includes/header/index.pug b/layout/includes/header/index.pug index 8e4ccf3..de2fdeb 100644 --- a/layout/includes/header/index.pug +++ b/layout/includes/header/index.pug @@ -47,7 +47,4 @@ header#page-header(class=isHomeClass style=bg_img) i.fas.fa-angle-down.scroll-down-effects else #page-site-info - h1#site-title=site_title - if theme.post_edit.enable - a.post-edit-link(href=post_edit(page.source) title=_p('post.edit')) - i.fa.fa-pen-nib + h1#site-title=site_title \ No newline at end of file diff --git a/layout/includes/header/post-info.pug b/layout/includes/header/post-info.pug index 96ca6be..0aafd66 100644 --- a/layout/includes/header/post-info.pug +++ b/layout/includes/header/post-info.pug @@ -1,7 +1,7 @@ #post-info h1.post-title= page.title || _p('no_title') if theme.post_edit.enable - a.post-edit-link(href=post_edit(page.source) title=_p('post.edit')) + a.post-edit-link(href=theme.post_edit.url + page.source title=_p('post.edit') target="_blank") i.fa.fa-pen-nib #post-meta diff --git a/package.json b/package.json index dcee1f8..5393d76 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.6.0-b4", + "version": "3.6.0-b5", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/scripts/helpers/page.js b/scripts/helpers/page.js index d9274fb..fd44158 100644 --- a/scripts/helpers/page.js +++ b/scripts/helpers/page.js @@ -70,9 +70,3 @@ hexo.extend.helper.register('injectHtml', function (data) { } return result }) - -hexo.extend.helper.register('post_edit', function(src) { - const { post_edit } = this.theme; - if (!post_edit.enable) return ''; - return post_edit.url + src -}) \ No newline at end of file diff --git a/source/css/_layout/head.styl b/source/css/_layout/head.styl index 1c737de..0194905 100644 --- a/source/css/_layout/head.styl +++ b/source/css/_layout/head.styl @@ -84,9 +84,6 @@ +maxWidth768() top: 7rem - .post-edit-link - padding-left: 0.3rem - // post &.post-bg height: 20rem @@ -144,9 +141,9 @@ +maxWidth768() font-size: 1.72em - + .post-edit-link - padding-left: 0.3rem + padding-left: .5rem #post-meta color: var(--light-grey) @@ -201,7 +198,7 @@ .post-edit-link float: right - + #post-meta, #post-meta a color: #78818a