From ce8ada144a5e7a6d7786ea16c6b3d54bc58b2816 Mon Sep 17 00:00:00 2001 From: yqchilde Date: Thu, 16 Apr 2020 19:55:18 +0800 Subject: [PATCH] update 1.0.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ✔ 升级Valine - ✔ 优化底部信息的为空展示 - 🎁 新增后台设置gravatar头像源,默认为极客族,感谢[@MuenYu](https://github.com/MuenYu) - 🎁 新增面包屑导航 - ❤ 文章页样式微调 --- CHANGELOG.md | 14 +- README.md | 2 +- functions.php | 4 +- header.php | 2 +- inc/Utils.php | 7 +- inc/js/rebirth.js | 10 +- inc/js/trick.js | 8 +- options.php | 19 +- page/page-about.php | 5 +- page/page-links.php | 30 +- style.css | 4068 ++++++++++++++++++++++++++++++++- tpl/footer/footer-info.php | 17 +- tpl/home/home-hero.php | 16 +- tpl/single/single-content.php | 87 +- tpl/single/single-header.php | 76 +- tpl/site/site-wave.php | 24 + 16 files changed, 4262 insertions(+), 127 deletions(-) create mode 100644 tpl/site/site-wave.php diff --git a/CHANGELOG.md b/CHANGELOG.md index f9a1c2c..1cc349f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,18 @@ +### Version 1.0.5 + +发布日期:2020.04.16 + +- ✔ 升级Valine +- ✔ 优化底部信息的为空展示 +- 🎁 新增后台设置gravatar头像源,默认为极客族,感谢[@MuenYu](https://github.com/MuenYu) +- 🎁 新增面包屑导航 +- ❤ 文章页样式微调 + ### Version 1.0.4 发布日期:2020.04.07 -- ✔ 修复文章内容添加锚节点不能稳定跳转 +- ✔ 修复文章内容添加锚节点不能稳定跳转 - 🎁 新增后台支持弹窗内容和时间 - ❤ 优化博客关键词和文章描述,更利用SEO @@ -10,7 +20,7 @@ 发布日期:2020.03.17 -- ✔ 修复两个函数判断非数组 +- ✔ 修复两个函数判断非数组 - 🎁 新增页脚展示功能 - 🎁 新增友链分类 - ❤ 优化首页文章布局 diff --git a/README.md b/README.md index 36afd81..bea9cdb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WordPress Theme - Rebirth -![](https://img.shields.io/github/v/release/yqchilde/rebirth.svg?style=flat-square) ![](https://img.shields.io/github/commits-since/yqchilde/rebirth/1.0.4?logo=dev&style=flat-square) +![](https://img.shields.io/github/v/release/yqchilde/rebirth.svg?style=flat-square) ![](https://img.shields.io/github/commits-since/yqchilde/rebirth/1.0.5?logo=dev&style=flat-square) ### 声明 Rebirth主题的WordPress版本是完全移植过来的,原主题为`JaxsonWang(淮城一只猫)制作`,且是ghost博客主题,详情请看 [点击查看](https://github.com/JaxsonWang/Rebirth) diff --git a/functions.php b/functions.php index f35f884..59d32ed 100644 --- a/functions.php +++ b/functions.php @@ -140,14 +140,12 @@ function rebirth_scripts() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js', array(), null, true ); wp_register_script( 'bootstrap', 'https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.bundle.min.js', array( 'jquery' ), null, true ); - wp_register_script( 'scrollreveal', 'https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js', array(), null, true ); - wp_register_script( 'valine', 'https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js', array(), null, true ); + wp_register_script( 'valine', 'https://cdn.jsdelivr.net/npm/valine@1.4.4/dist/Valine.min.js', array(), null, true ); wp_register_script( 'trick', get_template_directory_uri() . '/inc/js/trick.js', array(), Rebirth_Version, true ); wp_register_script( 'rebirth', get_template_directory_uri() . '/inc/js/rebirth.js', array(), Rebirth_Version, true ); wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'bootstrap' ); - wp_enqueue_script( 'scrollreveal' ); wp_enqueue_script( 'valine' ); wp_enqueue_script( 'trick' ); wp_enqueue_script( 'rebirth' ); diff --git a/header.php b/header.php index e0d3d1b..324e6c2 100644 --- a/header.php +++ b/header.php @@ -59,7 +59,7 @@ - + diff --git a/inc/Utils.php b/inc/Utils.php index cd9a04a..e6c89ea 100644 --- a/inc/Utils.php +++ b/inc/Utils.php @@ -134,7 +134,11 @@ function setPostViews( $postID ) { function gravatar_cn( $url ) { $gravatar_url = array( '0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com' ); - return str_replace( $gravatar_url, 'dn-qiniu-avatar.qbox.me', $url ); + if ( rebirth_option( 'gravatar_source' ) ) { + return str_replace( $gravatar_url, rebirth_option( 'gravatar_source' ), $url ); + } + + return str_replace( $gravatar_url, 'sdn.geekzu.org', $url ); } add_filter( 'get_avatar_url', 'gravatar_cn', 4 ); @@ -404,5 +408,6 @@ function wp_keywords() { if ( $keywords ) { //输出关键词 return $keywords; } + return ""; } \ No newline at end of file diff --git a/inc/js/rebirth.js b/inc/js/rebirth.js index 72353e6..162f2f2 100644 --- a/inc/js/rebirth.js +++ b/inc/js/rebirth.js @@ -7708,7 +7708,7 @@ function(t) { return regeneratorRuntime.wrap(function(t) { for (;;) switch (t.prev = t.next) { case 0: - return n = "https://cdn.jsdelivr.net/npm/prismjs@1.19.0", t.next = 3, e.document.querySelectorAll(".post-content pre>code"); + return n = "https://cdn.jsdelivr.net/npm/prismjs@1.20.0", t.next = 3, e.document.querySelectorAll(".post-content pre>code"); case 3: if (0 !== (r = t.sent).length) { t.next = 6; @@ -7890,13 +7890,7 @@ function(t) { }, 500) }) }), - N = (P(window), function(t) { - t.ScrollReveal().reveal(".home-post-item", { - delay: 100, - interval: 16, - reset: !0 - }) - }), + N = (P(window)), F = function() { ! function() { diff --git a/inc/js/trick.js b/inc/js/trick.js index 8f85ed0..aaf24ac 100644 --- a/inc/js/trick.js +++ b/inc/js/trick.js @@ -5,14 +5,16 @@ appId: rebirth_option.valine_appid, appKey: rebirth_option.valine_appkey, serverURLs: rebirth_option.valine_serverurls, - notify: !1, - verify: !0, avatar: "mm", visitor: !0, highlight: !0, recordIP: !0, placeholder: "请您理智发言,共建美好社会!", - path: window.location.pathname + path: window.location.pathname, + meta: ['nick', 'mail', 'link'], + pageSize: 10, + lang: 'zh-CN', + avatarForce: false }); let e = {}, t = $(this).index(), a = rebirth_option.home_url; diff --git a/options.php b/options.php index 9ff10b7..0a25fb6 100644 --- a/options.php +++ b/options.php @@ -215,7 +215,8 @@ function optionsframework_options() { 'std' => '{ "百度": "https://www.baidu.com", "Yq小站": "https://yqqy.top" -}'); +}' + ); // 作者信息 $options[] = array( @@ -249,6 +250,16 @@ function optionsframework_options() { 'type' => 'upload' ); + // gravatar头像源 + $options[] = array( + 'name' => 'gravatar头像源', + 'desc' => '这里填写你的gravatar头像中文源,默认使用极客族 + 不需要写http(s)://', + 'id' => 'gravatar_source', + 'std' => 'sdn.geekzu.org', + 'type' => 'text' + ); + // 自定义关键词和描述 $options[] = array( 'name' => '警示语 / 励志铭 / 描述', @@ -366,6 +377,12 @@ function optionsframework_options() { ), ); + // Valine配置提示 + $options[] = array( + 'name' => '主题评论采用第三方Valine系统', + 'desc' => 'Valine文档:https://valine.js.org', + 'type' => 'info' + ); // appId $options[] = array( diff --git a/page/page-about.php b/page/page-about.php index 1f3f1fb..5895b78 100644 --- a/page/page-about.php +++ b/page/page-about.php @@ -34,11 +34,12 @@ }
-
+
关于本站
- Yqchilde / / + Yqchilde / +
diff --git a/page/page-links.php b/page/page-links.php index 18bfd4f..b3b043a 100644 --- a/page/page-links.php +++ b/page/page-links.php @@ -38,7 +38,7 @@
友情链接
-
+
@@ -46,23 +46,27 @@

您好,我的朋友!


- - - + + +

name ?>

    - term_id); - foreach ($items as $v) : ?> + term_id ); + foreach ( $items as $v ) : ?>
-
- - - - - - - - - - - -
+ \ No newline at end of file diff --git a/tpl/single/single-content.php b/tpl/single/single-content.php index cee8631..007179a 100644 --- a/tpl/single/single-content.php +++ b/tpl/single/single-content.php @@ -7,7 +7,7 @@ * @link https://yqqy.top */ // 文章内容 -$blog_content = autoLinkNoFollow(get_the_content()); +$blog_content = autoLinkNoFollow( get_the_content() ); // 文章作者 $blog_author = esc_attr( get_the_author() ); @@ -16,36 +16,43 @@ // 文章标题 $blog_title = get_the_title(); // 作者头像 -$blog_avatar = get_avatar( get_the_author_meta( 'user_email' )); +$blog_avatar = get_avatar( get_the_author_meta( 'user_email' ) ); // 作者发布文章链接 $blog_author_others = esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); // 查看更多文章链接 $the_more_article_link = esc_url( get_category_link( get_the_category()[0]->term_id ) ); // 判断上一篇文章有没有 -if (get_previous_post() != null) { +if ( get_previous_post() != null ) { // 上一篇文章分类 $prev_blog_cat = get_category( get_the_category( get_previous_post()->ID )[0]->term_id )->cat_name; - // 上一篇文章链接 + // 上一篇文章链接 $prev_blog_link = get_permalink( get_previous_post()->ID ); } // 判断下一篇文章有没有 -if (get_next_post() != null) { +if ( get_next_post() != null ) { // 下一篇文章分类 $next_blog_cat = get_category( get_the_category( get_next_post()->ID )[0]->term_id )->cat_name; - // 下一篇文章链接 + // 下一篇文章链接 $next_blog_link = get_permalink( get_next_post()->ID ); } ?>
+
-
+
@@ -79,14 +86,14 @@ class="btn btn-tools-item btn-donation"
- 支付宝捐赠
请使用支付宝扫一扫进行捐赠
- 微信捐赠
请使用微信扫一扫进行赞赏
@@ -112,7 +119,8 @@ class="btn btn-tools-item btn-donation" +
+ + + + + + + + + + + +