Skip to content

Commit

Permalink
update 1.0.5
Browse files Browse the repository at this point in the history
- ✔ 升级Valine
- ✔ 优化底部信息的为空展示
- 🎁 新增后台设置gravatar头像源,默认为极客族,感谢[@MuenYu](https://github.com/MuenYu)
- 🎁 新增面包屑导航
- ❤ 文章页样式微调
  • Loading branch information
yqchilde committed Apr 16, 2020
1 parent 4777f93 commit ce8ada1
Show file tree
Hide file tree
Showing 16 changed files with 4,262 additions and 127 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
### Version 1.0.5

发布日期:2020.04.16

- ✔ 升级Valine
- ✔ 优化底部信息的为空展示
- 🎁 新增后台设置gravatar头像源,默认为极客族,感谢[@MuenYu](https://github.com/MuenYu)
- 🎁 新增面包屑导航
- ❤ 文章页样式微调

### Version 1.0.4

发布日期:2020.04.07

- ✔ 修复文章内容添加锚节点不能稳定跳转
- ✔ 修复文章内容添加锚节点不能稳定跳转
- 🎁 新增后台支持弹窗内容和时间
- ❤ 优化博客关键词和文章描述,更利用SEO

### Version 1.0.3

发布日期:2020.03.17

- ✔ 修复两个函数判断非数组
- ✔ 修复两个函数判断非数组
- 🎁 新增页脚展示功能
- 🎁 新增友链分类
- ❤ 优化首页文章布局
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 1 addition & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,12 @@ function rebirth_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js', array(), null, true );
wp_register_script( 'bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js', array( 'jquery' ), null, true );
wp_register_script( 'scrollreveal', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/scrollreveal.min.js', array(), null, true );
wp_register_script( 'valine', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/Valine.min.js', array(), null, true );
wp_register_script( 'valine', 'https://cdn.jsdelivr.net/npm/[email protected]/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' );
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<?php wp_head(); ?>

<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.12.0/css/all.min.css">
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css">
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@iconfu/[email protected]/dist/svg-inject.min.js"></script>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>?ver=<?php echo Rebirth_Version ?>" type="text/css" media="screen"/>
</head>
Expand Down
7 changes: 6 additions & 1 deletion inc/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -404,5 +408,6 @@ function wp_keywords() {
if ( $keywords ) { //输出关键词
return $keywords;
}

return "";
}
10 changes: 2 additions & 8 deletions inc/js/rebirth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down
8 changes: 5 additions & 3 deletions inc/js/trick.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
19 changes: 18 additions & 1 deletion options.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ function optionsframework_options() {
'std' => '{
"百度": "https://www.baidu.com",
"Yq小站": "https://yqqy.top"
}');
}'
);

// 作者信息
$options[] = array(
Expand Down Expand Up @@ -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' => '警示语 / 励志铭 / 描述',
Expand Down Expand Up @@ -366,6 +377,12 @@ function optionsframework_options() {
),
);

// Valine配置提示
$options[] = array(
'name' => '主题评论采用第三方Valine系统',
'desc' => 'Valine文档:<a href="https://valine.js.org" target="_blank">https://valine.js.org</a>',
'type' => 'info'
);

// appId
$options[] = array(
Expand Down
5 changes: 3 additions & 2 deletions page/page-about.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
}
</style>
<div class="main-hero-bg responsive-header-img"></div>
<div class="main-hero-header header-right"></div>
<?php get_template_part( 'tpl/site/site', 'wave' ); ?>
<div class="d-flex flex-column align-content-center justify-content-center main-hero-content">
<div class="text-center main-hero-content-title">关于本站</div>
<div class="text-center main-hero-content-description">
Yqchilde / <time datetime="2018-10-06">2020-02-09</time> /
Yqchilde /
<time datetime="2018-10-06">2020-02-09</time>
</div>
</div>
</section>
Expand Down
30 changes: 19 additions & 11 deletions page/page-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,35 @@
<div class="d-flex flex-column align-content-center justify-content-center main-hero-content">
<div class="text-center main-hero-content-title">友情链接</div>
</div>
<div class="main-hero-header header-left"></div>
<?php get_template_part( 'tpl/site/site', 'wave' ); ?>
</section>
<main class="main-content">
<div class="container-sm">
<div class="row">
<article class="post page borderbox post-content custom-links-template">
<p>您好,我的朋友! </p>
<hr>
<?php $linkCats = get_terms("link_category", "orderby=term_id") ?>
<?php if (!empty($linkCats)) : ?>
<?php foreach ($linkCats as $linkCat) : ?>
<?php $linkCats = get_terms( "link_category", "orderby=term_id" ) ?>
<?php if ( ! empty( $linkCats ) ) : ?>
<?php foreach ( $linkCats as $linkCat ) : ?>
<blockquote>
<p><?php echo $linkCat->name ?></p>
</blockquote>
<ul class="row mx-0">
<?php $items = getTheLinkItems($linkCat->term_id);
foreach ($items as $v) : ?>
<?php $items = getTheLinkItems( $linkCat->term_id );
foreach ( $items as $v ) : ?>
<li class="col-sm-12 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="shadow px-3 links-item-wrapper">
<div class="links-item-wrapper-header">
<a target="_blank" href="<?php echo $v['link_url'] ?>"><img src="<?php echo $v['link_image'] ?>" class="border links-item-wrapper-header-avatar" alt="<?php echo $v['link_name'] ?>"></a>
<a target="_blank" href="<?php echo $v['link_url'] ?>"><img
src="<?php echo $v['link_image'] ?>"
class="border links-item-wrapper-header-avatar"
alt="<?php echo $v['link_name'] ?>"></a>
</div>
<div class="links-item-wrapper-content">
<div class="links-item-wrapper-content-name">
<a target="_blank" href="<?php echo $v['link_url'] ?>"><?php echo $v['link_name'] ?></a>
<a target="_blank"
href="<?php echo $v['link_url'] ?>"><?php echo $v['link_name'] ?></a>
</div>
<div class="links-item-wrapper-content-desc"><?php echo $v['link_description'] ?></div>
</div>
Expand All @@ -74,15 +78,19 @@
<?php else : ?>
<ul class="row mx-0">
<?php $items = getTheLinkItems();
foreach ($items as $v) : ?>
foreach ( $items as $v ) : ?>
<li class="col-sm-12 col-md-6 col-lg-4 col-xl-4 mb-4">
<div class="shadow px-3 links-item-wrapper">
<div class="links-item-wrapper-header">
<a target="_blank" href="<?php echo $v['link_url'] ?>"><img src="<?php echo $v['link_image'] ?>" class="border links-item-wrapper-header-avatar" alt="<?php echo $v['link_name'] ?>"></a>
<a target="_blank" href="<?php echo $v['link_url'] ?>"><img
src="<?php echo $v['link_image'] ?>"
class="border links-item-wrapper-header-avatar"
alt="<?php echo $v['link_name'] ?>"></a>
</div>
<div class="links-item-wrapper-content">
<div class="links-item-wrapper-content-name">
<a target="_blank" href="<?php echo $v['link_url'] ?>"><?php echo $v['link_name'] ?></a>
<a target="_blank"
href="<?php echo $v['link_url'] ?>"><?php echo $v['link_name'] ?></a>
</div>
<div class="links-item-wrapper-content-desc"><?php echo $v['link_description'] ?></div>
</div>
Expand Down
4,068 changes: 4,066 additions & 2 deletions style.css

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions tpl/footer/footer-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
<div class="d-none d-lg-block py-5 col main-footer-info-tags">
<h3 class="mb-3 main-footer-info-title main-footer-info-tags-title">标签云</h3>
<div class="d-flex flex-row flex-wrap justify-content-center align-items-center w-100 h-100 main-footer-info-tags-list">
<?php $tags = get_tags();
foreach ( $tags as $v ) : ?>
<a href="<?php echo home_url() . '/tag/' . $v->slug; ?>"
class="tag-item"><?php echo $v->name; ?></a>
<?php endforeach; ?>
<?php if (get_tags()) : ?>
<?php $tags = get_tags();
foreach ( $tags as $v ) : ?>
<a href="<?php echo home_url() . '/tag/' . $v->slug; ?>"
class="tag-item"><?php echo $v->name; ?></a>
<?php endforeach; ?>
<?php else: ?>
暂无标签云
<?php endif; ?>

</div>
</div>
<div class="d-none d-lg-block py-5 col main-footer-info-navigation">
Expand All @@ -30,6 +35,8 @@ class="tag-item"><?php echo $v->name; ?></a>
<a href="<?php echo $v ?>"
class="list-group-item list-group-item-action menu-item side-menu-nav-item nav-bai-du nav-current active"><?php echo $k ?></a>
<?php endforeach; ?>
<?php else: ?>
暂无导航
<?php endif; ?>
</div>
</div>
Expand Down
16 changes: 1 addition & 15 deletions tpl/home/home-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,5 @@ class="text-center main-hero-content-description"><?php echo get_the_tags()[0]->
</div>
<?php endif; ?>
</div>
<div class="main-hero-waves-area waves-area">
<svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave"
d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"/>
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0"/>
<use xlink:href="#gentle-wave" x="48" y="3"/>
<use xlink:href="#gentle-wave" x="48" y="5"/>
<use xlink:href="#gentle-wave" x="48" y="7"/>
</g>
</svg>
</div>
<?php get_template_part('tpl/site/site', 'wave'); ?>
</section>
Loading

0 comments on commit ce8ada1

Please sign in to comment.