From 79971d49dbded45d306eedd0d2d8ce40b5582838 Mon Sep 17 00:00:00 2001 From: "hwy0127@gmail.com" Date: Fri, 14 Jun 2019 01:41:53 +0800 Subject: [PATCH] 1. fix Traditional Chinese and Simplified Chinese Conversion 2. Add the option to hidden the aside items #2 3. Add the option to change subtitle 4. Add the option to change the font 5. fix read-mode and night-mode 6. fix the bugs of the cover #2 --- README.md | 3 + _config.yml | 75 +++-- languages/default.yml | 19 +- languages/en.yml | 19 +- languages/zh-Hans.yml | 16 +- languages/zh-TW.yml | 16 +- layout/includes/additional-js.pug | 68 +---- layout/includes/aside.pug | 233 +++++++------- layout/includes/config.pug | 27 +- layout/includes/head.pug | 5 +- layout/includes/layout.pug | 2 +- layout/includes/rightside.pug | 12 +- scripts/related_post.js | 4 +- source/css/_global/index.styl | 13 +- source/css/_layout/nightshift.styl | 236 ++++++++++++++ source/css/_layout/post.styl | 1 - source/css/_layout/readmode.styl | 186 ++++++------ .../css/{other.styl => _layout/z-other.styl} | 0 source/css/index.styl | 5 +- source/css/nightshift.styl | 236 -------------- source/css/var.styl | 11 +- source/js/main.js | 138 ++++----- source/js/tw_cn.js | 287 ++++++------------ 23 files changed, 780 insertions(+), 832 deletions(-) create mode 100644 source/css/_layout/nightshift.styl rename source/css/{other.styl => _layout/z-other.styl} (100%) delete mode 100644 source/css/nightshift.styl diff --git a/README.md b/README.md index 9c02801..ea94962 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ git clone https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly theme: Butterfly ``` +>如果你没有pug以及stylus的渲染器,请下载安装: npm install hexo-renderer-jade hexo-renderer-stylus --save or yarn add hexo-renderer-jade hexo-renderer-stylus + ## 文档 可查看[这里](https://molunerfinn.com/hexo-theme-melody-doc/zh-Hans/#%E7%89%B9%E6%80%A7) @@ -36,6 +38,7 @@ comments: reward: description: top_img: +cover: (封面) --- ``` diff --git a/_config.yml b/_config.yml index 71b3b2e..e9a6df7 100644 --- a/_config.yml +++ b/_config.yml @@ -27,7 +27,7 @@ menu: # Favicon # use my-favicon.ico to avoid duplicate favicon of melody theme # --------------- -favicon: /img/favicon.png +favicon: /img/favicon.ico # PWA # See https://github.com/JLHwung/hexo-offline @@ -46,6 +46,7 @@ favicon: /img/favicon.png # Highlight theme # --------------- highlight_theme: light +highlight_copy: true code_word_wrap: false @@ -74,7 +75,7 @@ algolia_search: # Please see doc for more details: https://molunerfinn.com/hexo-theme-melody-doc/#/third-party-support?id=local-search # --------------- local_search: - enable: true + enable: false labels: input_placeholder: Search for Posts hits_empty: "We didn't find any results for the search: ${query}" # if there are no result @@ -234,7 +235,7 @@ disqus: # valine comment system. https://valine.js.org valine: - enable: false # if you want use valine,please set this value is ture + enable: false # if you want use valine,please set this value is true appId: # leancloud application app id appKey: # leancloud application app key notify: false # valine mail notify (true/false) https://github.com/xCss/Valine/wiki @@ -305,22 +306,17 @@ Flink: flinks: [ - {'name': '夢魘小棧', - 'link': 'https://blog.ihoey.com', - 'avatar': 'https://cdn.dode.top/avatar.png', - 'descr': '心,若沒有棲息的地方,到哪裏都是流浪......'}, - {'name': '冰峯博客', - 'link':'https://www.ad-s.cn/', - 'avatar': 'https://secure.gravatar.com/avatar/4074cd3e035c6e5796f6c263ef8ef0b8?s=56&d=wavatar&r=g', - 'descr': '男人就應該保持冷靜,沸騰的水只會被蒸發掉。'} + {'name': 'JerryC', + 'link': 'https://jerryc.me/', + 'avatar': 'https://jerryc.me/img/avatar.png', + 'descr': '今日事,今日畢'}, + {'name': 'molunerfinn', + 'link':'https://molunerfinn.com', + 'avatar': 'https://blog-1251750343.cos.ap-beijing.myqcloud.com/blog/avatar.jpeg', + 'descr': 'For MElody'} ] -## chinese traditional to Simplified -translate: - enable: true - - runtimeshow: enable: true start_date: 6/7/2018 00:00:00 @@ -366,15 +362,54 @@ canvas_ribbon_piao: enable: true -# 避免重复网址分散seo +# 避免重複網址分散seo canonical: true -# 禁止百度转码 +# 禁止百度轉碼 disable_baidu_transformation: true twitter_meta: true Open_Graph_meta: true - +#閲讀模式 readmode: - enable: true \ No newline at end of file + enable: true + +font: + enable: false + font-family: Lato, Helvetica Neue For Number, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB,"Microsoft JhengHei", "MicrMicrosoft YaHei", Helvetica Neue, Helvetica, Arial, sans-serif + code-font: consolas, Menlo, "PingFang SC", "Microsoft JhengHei","Microsoft YaHei", monospace, Helvetica Neue For Number + +# 主頁subtitle +subtitle: + enable: true + sub1: 今日事,今日畢 + sub2: Never put off till tomorrow what you can do today + +#側邊欄顯示設置 +aside: + card_author: true + card_announcement: true + card_recent_post: true + card_categories: true + card_tags: true + card_archives: true + card_webinfo: true + + +## chinese traditional to Simplified +translate: + enable: true + # 默認按鈕顯示文字 + default: 簡 + #网站默认语言,1: 繁體中文, 2: 简体中文 + defaultEncoding: 1 + #延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0 + translateDelay: 0 + #博客网址 + cookieDomain: "https://jerryc.me/" + #當文字是簡體時,按鈕顯示的文字 + msgToTraditionalChinese: "繁" + #當文字是繁體時,按鈕顯示的文字 + msgToSimplifiedChinese: "简" + \ No newline at end of file diff --git a/languages/default.yml b/languages/default.yml index 141d27d..9f72f85 100644 --- a/languages/default.yml +++ b/languages/default.yml @@ -25,7 +25,7 @@ post: created: Created updated: Updated wordcount: Word count - min2read: 'Reading time: %s min' + min2read: "Reading time: %s min" page_pv: Post View copyright: author: Author @@ -33,7 +33,6 @@ post: copyright_notice: Copyright Notice copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.' - search: Search algolia_search: input_placeholder: Search for Posts @@ -57,7 +56,7 @@ aside: tags: Tags categories: Categories card_announcement: Announcement - card_categories: Categories + card_categories: Categories card_tags: Tags card_archives: Archives card_recent_post: Recent Post @@ -70,4 +69,16 @@ aside: site_pv_name: PV donate: Donate -share: Share \ No newline at end of file +share: Share + +bookmark: + title: Bookmark + message_prev: Press + message_next: to bookmark this page + +rightside: + readmode_title: Read Mode + font_plus_title: Increase font size + font_minus_title: Decrease font size + translate_title: Traditional Chinese and Simplified Chinese Conversion + night_mode_title: Dark Mode diff --git a/languages/en.yml b/languages/en.yml index 622309c..5c15f54 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -25,7 +25,7 @@ post: created: Created updated: Updated wordcount: Word count - min2read: 'Reading time: %s min' + min2read: "Reading time: %s min" page_pv: Post View copyright: author: Author @@ -33,7 +33,6 @@ post: copyright_notice: Copyright Notice copyright_content: 'All articles in this blog are licensed under %s unless stating additionally.' - search: Search algolia_search: input_placeholder: Search for Posts @@ -57,7 +56,7 @@ aside: tags: Tags categories: Categories card_announcement: Announcement - card_categories: Categories + card_categories: Categories card_tags: Tags card_archives: Archives card_recent_post: Recent Post @@ -69,6 +68,16 @@ aside: site_uv_name: UV site_pv_name: PV - donate: Donate -share: Share \ No newline at end of file +share: Share +bookmark: + title: Bookmark + message_prev: Press + message_next: to bookmark this page + +rightside: + readmode_title: Read Mode + font_plus_title: Increase font size + font_minus_title: Decrease font size + translate_title: Traditional Chinese and Simplified Chinese Conversion + night_mode_title: Dark Mode \ No newline at end of file diff --git a/languages/zh-Hans.yml b/languages/zh-Hans.yml index ab256e6..8d7d2d1 100644 --- a/languages/zh-Hans.yml +++ b/languages/zh-Hans.yml @@ -25,7 +25,7 @@ post: created: 发表于 updated: 更新于 wordcount: 字数总计 - min2read: '阅读时长: %s 分钟' + min2read: "阅读时长: %s 分钟" page_pv: 阅读量 copyright: author: 文章作者 @@ -69,6 +69,16 @@ aside: site_uv_name: 本站访客数 site_pv_name: 本站总访问量 - donate: 打赏 -share: 分享 \ No newline at end of file +share: 分享 +bookmark: + title: 添加书签 + message_prev: 按 + message_next: 键将本页加入书签 + +rightside: + readmode_title: 阅读模式 + font_plus_title: 放大字体 + font_minus_title: 缩小字体 + translate_title: 简繁转换 + night_mode_title: 夜间模式 diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 171cc38..fa28553 100644 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -29,7 +29,7 @@ post: updated: 更新於 wordcount: 字數總計 commentcount: 評論數 - min2read: '閲讀時長: %s 分鐘' + min2read: "閲讀時長: %s 分鐘" page_pv: 閲讀量 copyright: author: 文章作者 @@ -74,6 +74,16 @@ aside: site_uv_name: 本站訪客數 site_pv_name: 本站總訪問量 - donate: 打賞 -share: 分享 \ No newline at end of file +share: 分享 +bookmark: + title: 添加書籤 + message_prev: 按 + message_next: 鍵將本頁加入書籤 + +rightside: + readmode_title: 閲讀模式 + font_plus_title: 放大字體 + font_minus_title: 縮小字體 + translate_title: 簡繁轉換 + night_mode_title: 夜間模式 \ No newline at end of file diff --git a/layout/includes/additional-js.pug b/layout/includes/additional-js.pug index be79496..9e351ae 100644 --- a/layout/includes/additional-js.pug +++ b/layout/includes/additional-js.pug @@ -10,40 +10,6 @@ if (theme.local_search && theme.local_search.enable) script(async src=url_for('/js/search/local-search.js')) -if theme.translate && theme.translate.enable - script(src=url_for('/js/tw_cn.js')) - script. - $(document).ready(function() { - initializeChineseConversion(); - }); - function simplifyTextInPage(simplified) { - if (simplified) { - $(document.body).t2s(); - $('#translateLink').addClass('simplified'); - $('#translateLink').text('繁'); - } else { - $(document.body).s2t(); - $('#translateLink').removeClass('simplified'); - $('#translateLink').text('簡'); - } - } - function initializeChineseConversion() { - var simplified = +Cookies.get('simplified'); - // ?lang=zh-Hans, ?lang=zh-Hant - var scriptCode = /[?&;]lang=[^&;]*(Han[st])/i.exec(window.location.search); - if (scriptCode) { - simplified = +(scriptCode[1].match(/Hans/i) != null); - Cookies.set('simplified', simplified, {expires: 7, path: '/'}); - } - simplifyTextInPage(simplified); - $('#translateLink').click(function() { - simplified = +!simplified; - Cookies.set('simplified', simplified, {expires: 7, path: '/'}); - simplifyTextInPage(simplified); - $(this).blur(); - }); - } - if theme.nightshift.enable script(src=url_for('js/nightshift.js')) @@ -60,39 +26,24 @@ if theme.activate_power_mode.enable POWERMODE.shake = true; // turn off shake document.body.addEventListener('input', POWERMODE); +if theme.translate && theme.translate.enable + script(src=url_for('/js/tw_cn.js')) + script. + translateInitilization() - - -//- script(src="https://unpkg.com/aos@next/dist/aos.js") -//- script. -//- $(".recent-post-item,.card_widget,#archive,.tag-cloud,#tag,.category-content,#category,#page,.flink").attr("data-aos","slide-up"); -//- AOS.init(); - - -script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module") - -//- if is_post() -//- script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9") -//- script. -//- var typed = new Typed("#typed", { -//- stringsElement: '#post-title-effects', -//- typeSpeed: 150, -//- loop: true, -//- backSpeed: 100 -//- }); - -if is_home() - script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9") +if is_home() && theme.subtitle.enable + script(src="https://cdn.jsdelivr.net/npm/typed.js@2.0.9") script. var typed = new Typed(".subtitle", { - strings: ["今日事,今日畢", "Never put off till tomorrow what you can do today"], + strings: ['!{theme.subtitle.sub1}','!{theme.subtitle.sub2}'], startDelay: 300, typeSpeed: 100, loop: true, backSpeed: 50 }); - + +if is_home() script. //首頁fullpage function alignContent() { @@ -130,3 +81,4 @@ if is_home() script(async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js") +script(src="https://cdn.jsdelivr.net/npm/instant.page@1.2.2/instantpage.min.js" type="module") diff --git a/layout/includes/aside.pug b/layout/includes/aside.pug index 86515f5..8bee0a9 100644 --- a/layout/includes/aside.pug +++ b/layout/includes/aside.pug @@ -1,125 +1,132 @@ -.card_widget.card-author - .card-content - .post_data - .data-item.text-center - img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`) - p.author-info__name.text-center= config.author - p.author-info__description.text-center= config.description - - .post_data.data_config - if site.posts.length +if theme.aside.card_author + .card_widget.card-author + .card-content + .post_data .data-item.text-center - .data_link - a(href=url_for(config.archive_dir) + '/') - p.headline= _p('aside.articles') - p.length_num= site.posts.length + img.lozad(data-src=theme.avatar || url_for('/img/avatar.png') onerror=`onerror=null;src='${theme.lodding_bg.flink}'`) + p.author-info__name.text-center= config.author + p.author-info__description.text-center= config.description - if site.tags.length - .data-item.text-center - .data_link - a(href=url_for(config.tag_dir) + '/' ) - p.headline= _p('aside.tags') - p.length_num= site.tags.length - - if site.categories.length - .data-item.text-center - .data_link - a(href=url_for(config.category_dir) + '/') - p.headline= _p('aside.categories') - p.length_num= site.categories.length - - .post_data.text-center - a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me' - - - - if(theme.social) .post_data.data_config - #aside-social-icons - each url, icon in theme.social - a.social-icon.data-item(href=url target="_blank") - i(class=icon) + if site.posts.length + .data-item.text-center + .data_link + a(href=url_for(config.archive_dir) + '/') + p.headline= _p('aside.articles') + p.length_num= site.posts.length -.card_widget.card-announcement - .card-content - .item_headline - i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true") - span= _p('aside.card_announcement') - .announcement_content= theme.announcement.content + if site.tags.length + .data-item.text-center + .data_link + a(href=url_for(config.tag_dir) + '/' ) + p.headline= _p('aside.tags') + p.length_num= site.tags.length -.card_widget.card-recent-post - .card-content - .item_headline - i.fa.fa-history(aria-hidden="true") - span= _p('aside.card_recent_post') - .aside_recent_item - - site.posts.sort('date', -1).limit(5).each(function(article){ - .aside_recent_post - - var link = article.link || article.path - a(href=url_for(link)) - - var post_cover = article.cover - - var default_post_cover = theme.default_cover - .aside_post_cover - if (post_cover) - img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title')) - else - img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title')) - div#aside_title - .aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title') - if (theme.post_meta.date_type) - - var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' - time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)] + if site.categories.length + .data-item.text-center + .data_link + a(href=url_for(config.category_dir) + '/') + p.headline= _p('aside.categories') + p.length_num= site.categories.length + + .post_data.text-center + a#bookmark-it.data-item.bookmark.bookmarke--primary.bookmark--animated(href="javascript:;" title= _p('aside.card_bookmark') )= _p('aside.card_bookmark') || 'Follow Me' + - - }) + + if(theme.social) + .post_data.data_config + #aside-social-icons + each url, icon in theme.social + a.social-icon.data-item(href=url target="_blank") + i(class=icon) + +if theme.aside.card_announcement + .card_widget.card-announcement + .card-content + .item_headline + i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true") + span= _p('aside.card_announcement') + .announcement_content= theme.announcement.content + +if theme.aside.card_recent_post + .card_widget.card-recent-post + .card-content + .item_headline + i.fa.fa-history(aria-hidden="true") + span= _p('aside.card_recent_post') + .aside_recent_item + - site.posts.sort('date', -1).limit(5).each(function(article){ + .aside_recent_post + - var link = article.link || article.path + a(href=url_for(link)) + - var post_cover = article.cover + - var default_post_cover = theme.default_cover + .aside_post_cover + if (post_cover) + img.aside_post_bg.lozad(data-src=`${post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title')) + else + img.aside_post_bg.lozad(data-src=`${default_post_cover}` onerror=`onerror=null;src='${theme.lodding_bg.post_page}'` title=article.title || _p('no_title')) + div#aside_title + .aside_post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title') + if (theme.post_meta.date_type) + - var date_type = theme.post_meta.date_type == 'updated' ? 'updated' : 'date' + time.aside_post_meta.post-meta__date #[=date(article[date_type], config.date_format)] -.card_widget.card-categories - .card-content - .item_headline - i.fa.fa-folder-open(aria-hidden="true") - span= _p('aside.card_categories') - ul.aside_category_item - - site.categories.sort('name').each(function(category){ - li.aside_category_list - a.aside_category_list_link(href='/' + `${category.path}`) - span.aside_category_list_name= category.name - span.aside_category_list_length= category.length - - }) + - }) -.card_widget.card-tags - .card-content - .item_headline - i.fa.fa-tags(aria-hidden="true") - span= _p('aside.card_tags') - .card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'}) +if theme.aside.card_categories + .card_widget.card-categories + .card-content + .item_headline + i.fa.fa-folder-open(aria-hidden="true") + span= _p('aside.card_categories') + ul.aside_category_item + - site.categories.sort('name').each(function(category){ + li.aside_category_list + a.aside_category_list_link(href='/' + `${category.path}`) + span.aside_category_list_name= category.name + span.aside_category_list_length= category.length + - }) -.card_widget.card-archives - .card-content - .item_headline - i.fa.fa-archive(aria-hidden="true") - span= _p('aside.card_archives') - div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'}) +if theme.aside.card_tags + .card_widget.card-tags + .card-content + .item_headline + i.fa.fa-tags(aria-hidden="true") + span= _p('aside.card_tags') + .card-tag-cloud!= tagcloud({min_font: 16, max_font: 24, amount: 200, color: true, start_color: '#999', end_color: '#000'}) -.card_widget.card-webinfo - .card-content - .item_headline - i.fa.fa-line-chart(aria-hidden="true") - span= _p('aside.card_webinfo.headline') - .webinfo - .webinfo_item - .webinfo_article_name= _p('aside.card_webinfo.article_name') + " :" - .webinfo_article_count= site.posts.length - if theme.runtimeshow.enable +if theme.aside.card_archives + .card_widget.card-archives + .card-content + .item_headline + i.fa.fa-archive(aria-hidden="true") + span= _p('aside.card_archives') + div.archives_item!= list_archives({type:'monthly',format: 'YYYY年MM月'}) + +if theme.aside.card_webinfo + .card_widget.card-webinfo + .card-content + .item_headline + i.fa.fa-line-chart(aria-hidden="true") + span= _p('aside.card_webinfo.headline') + .webinfo .webinfo_item - .webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :" - #webinfo_runtime_count.webinfo_runtime_count - script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date) - - if theme.busuanzi.site_uv - .webinfo_item - .webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :" - .webinfo_site_uv_count#busuanzi_value_site_uv - if theme.busuanzi.site_pv - .webinfo_item - .webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :" - .webinfo_site_pv_count#busuanzi_value_site_pv + .webinfo_article_name= _p('aside.card_webinfo.article_name') + " :" + .webinfo_article_count= site.posts.length + if theme.runtimeshow.enable + .webinfo_item + .webinfo_runtime_name= _p('aside.card_webinfo.runtime_name') + " :" + #webinfo_runtime_count.webinfo_runtime_count + script#runtionshow(src=url_for('js/runtimeshow.js') start_date=theme.runtimeshow.start_date) + + if theme.busuanzi.site_uv + .webinfo_item + .webinfo_site_uv_name= _p('aside.card_webinfo.site_uv_name') + " :" + .webinfo_site_uv_count#busuanzi_value_site_uv + if theme.busuanzi.site_pv + .webinfo_item + .webinfo_site_name= _p('aside.card_webinfo.site_pv_name') + " :" + .webinfo_site_pv_count#busuanzi_value_site_pv diff --git a/layout/includes/config.pug b/layout/includes/config.pug index 65adbbe..949d250 100644 --- a/layout/includes/config.pug +++ b/layout/includes/config.pug @@ -26,14 +26,39 @@ } }) } + + if (theme.translate && theme.translate.enable){ + var defaultEncoding; + translate = JSON.stringify({ + defaultEncoding: theme.translate.defaultEncoding, + translateDelay: theme.translate.translateDelay, + cookieDomain: theme.translate.cookieDomain, + msgToTraditionalChinese: theme.translate.msgToTraditionalChinese, + msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese + }) + } + + + + + script. var GLOBAL_CONFIG = { root: '!{config.root}', algolia: !{algolia}, localSearch: !{localSearch}, + translate: !{translate}, + highlight_copy: '!{theme.highlight_copy}', copy: { success: '!{_p("copy.success")}', error: '!{_p("copy.error")}', noSupport: '!{_p("copy.noSupport")}' + }, + bookmark: { + title: '!{_p("bookmark.title")}', + message_prev: '!{_p("bookmark.message_prev")}', + message_next: '!{_p("bookmark.message_next")}' } - } \ No newline at end of file + + } + diff --git a/layout/includes/head.pug b/layout/includes/head.pug index 457a7ca..5d867c2 100644 --- a/layout/includes/head.pug +++ b/layout/includes/head.pug @@ -52,8 +52,7 @@ if (theme.gitalk && theme.gitalk.enable) script(src="https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js") script(src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js") -//- if (theme.pwa && theme.pwa.enable) -//- link(rel="manifest" href=theme.pwa.manifest) + if (theme.pwa && theme.pwa.enable) link(rel="manifest" href=theme.pwa.manifest) @@ -69,8 +68,6 @@ if (theme.pwa && theme.pwa.enable) link(rel="icon" type="image/png" sizes="16x16" href=theme.pwa.favicon_16_16) if(theme.pwa.mask_icon) link(rel="mask-icon" href=theme.pwa.mask_icon color="#5bbad5") - if(theme.pwa.shortcut_icon) - link(rel="shortcut icon", href=theme.pwa.shortcut_icon) if theme.baidu_analytics diff --git a/layout/includes/layout.pug b/layout/includes/layout.pug index 7d9d28e..6b476fe 100644 --- a/layout/includes/layout.pug +++ b/layout/includes/layout.pug @@ -32,7 +32,7 @@ html(lang=config.language) meta(name="author" content=pageAuthor) meta(name="copyright" content=pageCopyright) meta(name ="format-detection" content="telephone=no") - //- !=favicon_tag(config.favicon || theme.favicon || '/favicon.ico') + !=favicon_tag(config.favicon || theme.favicon || '/favicon.ico') if theme.stylesheets !== undefined && theme.stylesheets.length > 0 each url in theme.stylesheets link(rel='stylesheet', href=url_for(url)) diff --git a/layout/includes/rightside.pug b/layout/includes/rightside.pug index 20640c0..92bbb86 100644 --- a/layout/includes/rightside.pug +++ b/layout/includes/rightside.pug @@ -1,11 +1,9 @@ section#rightside.rightside if theme.readmode.enable && is_post() - i#readmode.fa.fa-book - i#font_plus.fa.fa-plus - i#font_minus.fa.fa-minus - if page.comments !== false && !is_home() && !is_archive() - i#to_comment.fa.fa-comments-o + i#readmode.fa.fa-book(title=_p('rightside.readmode_title')) + i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title')) + i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title')) if theme.translate && theme.translate.enable - a#translateLink.translate_chn_to_cht=theme.translate.show + a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title'))= theme.translate.default if theme.nightshift.enable - i#nightshift.fa.fa-moon-o.nightshift + i#nightshift.fa.fa-moon-o.nightshift(title=_p('rightside.night_mode_title')) diff --git a/scripts/related_post.js b/scripts/related_post.js index 19e14d6..1732904 100644 --- a/scripts/related_post.js +++ b/scripts/related_post.js @@ -24,8 +24,10 @@ hexo.extend.helper.register('related_posts', function(currentPost, allPosts){ var result = '