diff --git a/README.md b/README.md index 663647164..78b2a7b0a 100644 --- a/README.md +++ b/README.md @@ -20,16 +20,15 @@ ## General 概括 -[![Version](https://img.shields.io/badge/version-1.3.4-green.svg?style=flat-square)]() +[![Version](https://img.shields.io/badge/version-1.4.0-green.svg?style=flat-square)]() +[![Author](https://img.shields.io/badge/author-Viosey-blue.svg?style=flat-square)](https://viosey.com) + [![Hexo](https://img.shields.io/badge/hexo-3.0+-green.svg?style=flat-square)](https://hexo.io) [![node.js](https://img.shields.io/badge/node.js-6.0%2B-green.svg?style=flat-square)](https://nodejs.org/) [![Build Status](https://img.shields.io/travis/viosey/hexo-theme-material.svg?style=flat-square)](https://travis-ci.org/viosey/hexo-theme-material) [![npm](https://img.shields.io/npm/dt/hexo-material.svg?style=flat-square)](https://www.npmjs.com/package/hexo-material) -[![Author](https://img.shields.io/badge/author-Viosey-blue.svg?style=flat-square)](https://viosey.com) -[![QQ Group](https://img.shields.io/badge/QQ%20%E7%BE%A4-566308505-blue.svg?style=flat-square)](http://jq.qq.com/?_wv=1027&k=40Vdy24) - ## Demo 演示 [Viosey's Blog](https://blog.viosey.com) diff --git a/_config.template.yml b/_config.template.yml index 1137dcc8d..fa8f9e4cb 100644 --- a/_config.template.yml +++ b/_config.template.yml @@ -8,6 +8,13 @@ head: high_res_favicon: "/img/favicon.png" apple_touch_icon: "/img/favicon.png" keywords: + site_verification: + google: + baidu: + + # Enable generate structured-data as JSON+LD for SEO or not. + # Set as 'false' if it cause some wrong when `hexo g`. + structured_data: true # Jump Links Settings url: @@ -67,7 +74,6 @@ img: avatar: "/img/avatar.png" daily_pic: "/img/daily_pic.png" sidebar_header: "/img/sidebar_header.png" - footerico: "/img/footer/footer_ico-" random_thumbnail: "/img/random/material-" footer_image: #upyun_logo: @@ -75,16 +81,43 @@ img: #src: "/img/upyun_logo.svg" # Custom Fonts -fonts: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif +# family: the font-family which will be used in the theme +# host: uri of fonts host. +# Available value of "host": google | baomitu | ustc | custom +fonts: + family: Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif + use: google + custom_font_host: # Card Elevation Level card_elevation: 2 +# Copyright +# Specify the date when the site was setup. +# For example, if you set it as 2015, then footer will show '© 2015 - 2017' +copyright_since: + +# Qrcode for redirect at other device +# use: choose which method to generate the qrcode for each posts. +# Available value of "use": plugin | online +# - When use "plugin", you need to install the hexo-helper-qrcode. +# - When use "online", the qrcode will be generated by 'pan.baidu.com' in China. +qrcode: + enable: false + use: plugin + # --------------------------------------------------------------- # Menu Settings # --------------------------------------------------------------- +# TOC Button + +toc: +# use: choose whether the line_number of toc will show or not. +# Available value of "linenumber": true | false + linenumber: true + # SNS Menu sns: email: youremail@email.com @@ -143,8 +176,6 @@ sidebar: feedback: false material: false -# Qrcode for redirect at other device -qrcode: false # --------------------------------------------------------------- # Integrated Services @@ -159,15 +190,15 @@ materialcdn: # Comment Systems # Available value of "use": -# duoshuo | disqus | disqus_click | changyan +# disqus | disqus_click | changyan | 163gentie comment: use: - shortname: - duoshuo_thread_key_type: path - duoshuo_embed_js_url: "https://static.duoshuo.com/embed.js" + shortname: # duoshuo or disqus shortname changyan_appid: changyan_conf: changyan_thread_key_type: path + gentie_productKey: + # Search Systems # Available value: # swiftype | google | local @@ -176,9 +207,11 @@ search: swiftype_key: # Analytics Systems +# Available value: +# baidu | google | cnzz analytics: - baidu_id: - google_id: + use: + site_id: # Leancloud Views leancloud: @@ -192,4 +225,4 @@ busuanzi: enable: false all_site_uv: false post_pv: false - busuanzi_pure_mini_js: "https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js" + busuanzi_pure_mini_js: "https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js" \ No newline at end of file diff --git a/languages/ar.yml b/languages/ar.yml index 745b4b143..8c10605d4 100644 --- a/languages/ar.yml +++ b/languages/ar.yml @@ -8,7 +8,6 @@ post: continue: "واصل القراءة" older: "أقدم" newer: "أحدث" - private: "منشور خاص, مخفي مؤقتا" qrcode: "اقرأ هذا المقال على جهاز آخر" comments_load_button: "قراءة تعليقات 「تأكد !disq.us & disquscdn.com & disqus.com يمكن تحميل」" share: diff --git a/languages/de.yml b/languages/de.yml index fcc6b7f31..041775b0e 100644 --- a/languages/de.yml +++ b/languages/de.yml @@ -8,7 +8,6 @@ post: continue: "Weiterlesen" older: "Älteren" newer: "Neuren" - private: "Private Beiträge sind temporär verborgen" qrcode: "Lesen Sie diesen Artikel auf anderem Gerät" comments_load_button: "Lesen Sie Kommentare 「Stellen Sie sicher, dass 'disq.us & disquscdn.com & disqus.com' geladen werden kann 」" share: diff --git a/languages/en.yml b/languages/en.yml index 5924d4389..44f0a8e2b 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -5,12 +5,11 @@ sidebar: post: visitor: "Visitors" views: "Views" - continue: "Continue Reading" + continue: "Read more" older: "Older" newer: "Newer" - private: "Private post, temporarily hidden" - qrcode: "Read this article on other device" - comments_load_button: "Read Comments (Be sure disq.us, disquscdn.com and disqus.com can load properly)" + qrcode: "Read this article on other devices" + comments_load_button: "Read Comments (Make sure disq.us, disquscdn.com and disqus.com can load properly)" share: article_rss: "Article RSS" comment_rss: "Comment RSS" diff --git a/languages/es.yml b/languages/es.yml index 40c4bdb68..151d13bfc 100644 --- a/languages/es.yml +++ b/languages/es.yml @@ -8,7 +8,6 @@ post: continue: "Sigue leyendo" older: "Mayor" newer: "Más nuevo" - private: "Mensajes privados, ocultar temporalmente" qrcode: "Lea este artículo en otro dispositivo" comments_load_button: "Leer comentarios 「Asegúrese de que 'disq.us & disquscdn.com & disqus.com' se puede cargar」" share: diff --git a/languages/fr.yml b/languages/fr.yml index e8e14a40a..d4d72a1ac 100644 --- a/languages/fr.yml +++ b/languages/fr.yml @@ -8,7 +8,6 @@ post: continue: "Continuer la lecture" older: "Ancien" newer: "Récent" - private: "Article privé, caché temporairement" qrcode: "Lire cet article depuis un autre appareil" comments_load_button: "Lire les commentaires (Assurez-vous que disq.us, disquscdn.com et disqus.com peuvent être chargés)" share: diff --git a/languages/ja.yml b/languages/ja.yml index d694f8fb4..ac01860f4 100644 --- a/languages/ja.yml +++ b/languages/ja.yml @@ -8,7 +8,6 @@ post: continue: "読み続けて" older: "古い" newer: "新しい" - private: "プライベート記事、一時的に非表示にします" qrcode: "他のデバイスでこの記事を読む" comments_load_button: "論評を読む「 あなたは disqus & disquscdn.com & disqus.com をロードできることを確認します」" share: diff --git a/languages/ms.yml b/languages/ms.yml index cdfef3365..1160071cb 100644 --- a/languages/ms.yml +++ b/languages/ms.yml @@ -8,7 +8,6 @@ post: continue: "Teruskan Membaca" older: "Lama" newer: "Baru" - private: "Siaran peribadi, disembunyikan buat sementara" qrcode: "Baca artikel ini pada peranti lain" comments_load_button: "Read comments 「Pastikan 'disq.us & disquscdn.com & disqus.com' boleh dimuatkan」" share: diff --git a/languages/pt-BR.yml b/languages/pt-BR.yml index 3919e9452..618225178 100644 --- a/languages/pt-BR.yml +++ b/languages/pt-BR.yml @@ -8,7 +8,6 @@ post: continue: "Continue lendo" older: "Anteriores" newer: "Recentes" - private: "Artigo privado, aguarde." qrcode: "Veja este artigo em outro dispositivo" share: article_rss: "Artigos RSS" diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 69e1caf57..72cb7d5f1 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -8,9 +8,10 @@ post: continue: "阅读全文" older: "旧篇" newer: "新篇" - private: "私有文章,暂不公开" qrcode: "在其它设备中阅读本文章" - comments_load_button: "阅读评论 「请确保 disq.us & disquscdn.com & disqus.com 可以正常加载」" + comments_load_button: "阅读评论(请确保 disqus 可以正常加载)" + comments_fully_load_button: "加载完整评论(请确保 disqus 可以正常加载)" + comments_proxy_load_button: "加载评论基本模式" share: article_rss: "文章 RSS" comment_rss: "评论 RSS" diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml index 1368dcd26..bfe794989 100644 --- a/languages/zh-TW.yml +++ b/languages/zh-TW.yml @@ -8,7 +8,6 @@ post: continue: "繼續閱讀" older: "舊篇" newer: "新篇" - private: "私有文章,暫不公開" qrcode: "在其他設備中閱讀本文章" comments_load_button: "閱讀評論 「請確認 disq.us & disquscdn.com & disqus.com 可正常載入」" share: diff --git a/layout/_partial/Paradox-post-info.ejs b/layout/_partial/Paradox-post-info.ejs index c902a2a2e..dc99dab7f 100644 --- a/layout/_partial/Paradox-post-info.ejs +++ b/layout/_partial/Paradox-post-info.ejs @@ -21,17 +21,8 @@ --> - <% if(theme.qrcode === true) { %> - - + <% if(theme.qrcode.enable === true) { %> + <%- partial('_widget/qrcode') %> <% } %> diff --git a/layout/_partial/Paradox-post-thumbnail.ejs b/layout/_partial/Paradox-post-thumbnail.ejs index 5198193b1..1eefb8183 100644 --- a/layout/_partial/Paradox-post-thumbnail.ejs +++ b/layout/_partial/Paradox-post-thumbnail.ejs @@ -1,4 +1,4 @@ - <% } %> -<% if(theme.comment.use === 'duoshuo') { %> - - - -<% } %> -<% if(theme.comment.use == "changyan"){ %> - - - -<% } %> - -<% if(theme.comment.use === 'disqus') { %> - - +<% if(theme.comment.use){ %> + <%- partial('_widget/comment/' + theme.comment.use + '/common') %> <% } %> diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index 23a5aae08..e3551718d 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -6,12 +6,7 @@ diff --git a/layout/_partial/footer_top.ejs b/layout/_partial/footer_top.ejs index 2f39d7e42..f4688edf7 100644 --- a/layout/_partial/footer_top.ejs +++ b/layout/_partial/footer_top.ejs @@ -1,4 +1,4 @@ -
+
expand_less diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 817236b18..18cfc1b67 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -1,8 +1,10 @@ + + Version: 1.4.0 --> + <% @@ -32,9 +34,6 @@ <%= config.title %> - - - <% if(theme.materialcdn.use === true) { %> @@ -46,30 +45,47 @@ <% if(theme.comment.use == "changyan"){ %> <% } %> - <% if(theme.analytics.baidu_id) { %> + <% if(theme.analytics.use === "baidu") { %> <% } %> - <% if(theme.analytics.google_id) { %> + <% if(theme.analytics.use === "google") { %> <% } %> + <% if(theme.analytics.use === "cnzz") { %> + + <% } %> <% if(theme.busuanzi.enable === true) { %> <% } %> + <% if(theme.fonts.host === "google") { %> + + + <% } %> + <% if(theme.fonts.host === "baomitu") { %> + + <% } %> + <% if(theme.qrcode.use === "online" && theme.qrcode.enable === "true") { %> + + <% } %> + - + - + + + <% if(theme.head.site_verification.google) { %><% } %> + <% if(theme.head.site_verification.baidu) { %><% } %> + - @@ -88,9 +104,34 @@ - + + <% if(page.tags && page.tags.each) { page.tags.each(function(tag){ %> <% })} %> + <% if( (is_post()) ) { %> + + + <% } %> + + + + + + + + + + <% if( (page.current === 1) && (is_home()) ) { %> + + <% } else { %> + + <% } %> + + + <% if(theme.head.structured_data === true) { %> + <%- partial('_partial/structured-data') %> + <% } %> + + + + <% if(theme.materialcdn.use === true) { %> - - + <%- cssLsload({path:(theme.materialcdn.base + '/css/material.min.css'),key:'css/material.min.css'}) %> + <%- cssLsload({path:(theme.materialcdn.base + '/css/style.min.css'),key:'css/style.min.css'}) %> + <% if(theme.scheme === 'Isolation') { %> + <%- cssLsload({path:(theme.materialcdn.base + '/css/fontawesome.min.css'),key:'css/fontawesome.min.css'}) %> + <% } %> + <% if(theme.scheme === 'Paradox') { %> + <%- partial('_partial/config_footer') %> + <% } %> <%- partial('_partial/config_css') %> - - + <%- jsLsload({path:(theme.materialcdn.base + '/js/jquery.min.js'),key:'js/jquery.min.js'}) %> <%}else{%> - <%- css('css/material.min') %> - <%- css('css/style.min') %> + <%- cssLsload('css/material.min.css') %> + <%- cssLsload('css/style.min.css') %> + <% if(theme.scheme === 'Isolation') { %> + <%- cssLsload('/css/fontawesome.min.css') %> + <% } %> + <% if(theme.scheme === 'Paradox') { %> + <%- partial('_partial/config_footer') %> + <% } %> <%- partial('_partial/config_css') %> - <%- js('js/jquery.min') %> - <%- js('js/queue') %> + <%- jsLsload('js/jquery.min.js') %> <%}%> + + - - - - <% if(theme.analytics.baidu_id) { %> - - - <% } %> - - <% if(theme.analytics.google_id) { %> - - - <% } %> - - - - <% if(theme.background.bing.enable) { %> - - <% } %> + + <% if(theme.analytics.use) { %><%- partial('_widget/analytics/' + theme.analytics.use + '-analytics') %><% } %> <% if (site.data.head) { %> diff --git a/layout/_partial/import_js.ejs b/layout/_partial/import_js.ejs index efe48d6f7..d8e15208b 100644 --- a/layout/_partial/import_js.ejs +++ b/layout/_partial/import_js.ejs @@ -1,25 +1,26 @@ + <% if(theme.materialcdn.use === true) { %> - - + <%- jsLsload({path:(theme.materialcdn.base + '/js/lazyload.min.js'),key:'js/lazyload.min.js'}) %> + <%- jsLsload({path:(theme.materialcdn.base + '/js/js.min.js'),key:'js/js.min.js'}) %> <%}else{%> - <%- js('js/lazyload.min') %> - <%- js('js/js.min') %> + <%- jsLsload('js/lazyload.min.js') %> + <%- jsLsload('js/js.min.js') %> <%}%> <%- partial('_widget/nprogress') %> <% if( theme.js_effect.smoothscroll === true ) { %> <% if(theme.materialcdn.use === true) { %> - + <%- jsLsload({path:(theme.materialcdn.base + '/js/smoothscroll.js'),key:'js/smoothscroll.js'}) %> <%}else{%> - <%- js('js/smoothscroll') %> + <%- jsLsload('js/smoothscroll.js') %> <%}%> <% } %> <%- partial('_partial/footer-option') %> -<% if( (page.current === 1) && (is_home()) ) { %> +<% if( (page.current === 1) && (is_home()) ) { %> <% if( theme.search.use === 'swiftype' ) { %> <%- partial('_widget/search-swiftype-js') %> @@ -29,7 +30,7 @@ <% if( theme.search.use === 'local' ) { %> <%- partial('_widget/search-local-js') %> - + + + + + +<% if(theme.background.bing.enable) { %> + +<% } %> + + diff --git a/layout/_partial/isolate_info.ejs b/layout/_partial/isolate_info.ejs index 709156504..859503bbc 100644 --- a/layout/_partial/isolate_info.ejs +++ b/layout/_partial/isolate_info.ejs @@ -52,7 +52,7 @@ <% for (var i in theme.sidebar.pages) { %> - + <%= i %> diff --git a/layout/_partial/post-info-share.ejs b/layout/_partial/post-info-share.ejs index 9af31f3b9..245779e74 100644 --- a/layout/_partial/post-info-share.ejs +++ b/layout/_partial/post-info-share.ejs @@ -27,7 +27,7 @@ <% if(theme.sns_share.weibo === true) { %> - +
  • <%= __('share.toWeibo') %>
  • @@ -36,7 +36,7 @@ <% if(theme.sns_share.twitter === true) { %> -
    +
  • <%= __('share.toTwitter') %>
  • @@ -45,7 +45,7 @@ <% if(theme.sns_share.facebook === true) { %> -
    +
  • <%= __('share.toFacebook') %>
  • @@ -54,7 +54,7 @@ <% if(theme.sns_share.googleplus === true) { %> -
    +
  • <%= __('share.toGplus') %>
  • @@ -63,7 +63,7 @@ <% if(theme.sns_share.linkedin === true) { %> -
    +
  • <%= __('share.toLinkedIn') %>
  • @@ -81,7 +81,7 @@ <% if(theme.sns_share.telegram === true) { %> -
    +
  • <%= __('share.toTelegram') %>
  • diff --git a/layout/_partial/sidebar-footer_image.ejs b/layout/_partial/sidebar-footer_image.ejs index 724bd6d99..ae0d50a49 100644 --- a/layout/_partial/sidebar-footer_image.ejs +++ b/layout/_partial/sidebar-footer_image.ejs @@ -1,7 +1,7 @@ <% for (var i in theme.img.footer_image) { %>
    - <%= i %> - + <%= i %> <% } %> diff --git a/layout/_partial/sidebar-navigation.ejs b/layout/_partial/sidebar-navigation.ejs index 4ec13b362..6e64cb149 100644 --- a/layout/_partial/sidebar-navigation.ejs +++ b/layout/_partial/sidebar-navigation.ejs @@ -18,7 +18,7 @@ <% if(theme.sidebar.homepage.use === true) { %>