主题
主题来自handsome
魔改版主题
魔改版主题来自神代綺凜主题
本站基于Sanakey的插件实现上述魔改
参考下面这篇文章
代码块美化
代码块美化基于如下插件
文末版权信息
基于如下插件
网站底部
在主题后台设置自定义CSS添加如下代码
/*底部页脚*/
.github-badge {
display: inline-block;
border-radius: 4px;
text-shadow: none;
font-size: 12px;
color: #fff;
line-height: 15px;
background-color: #abbac3;
margin-bottom: 5px
}
.github-badge .badge-subject {
display: inline-block;
background-color: #4d4d4d;
padding: 4px 4px 4px 6px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px
}
.github-badge .badge-value {
display: inline-block;
padding: 4px 6px 4px 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px
}
.github-badge .bg-blue {
background-color: #007ec6
}
.github-badge .bg-orange {
background-color: #ffa500
}
.github-badge .bg-red {
background-color: #f00
}
.github-badge .bg-green {
background-color: #3bca6e
}
.github-badge .bg-purple {
background-color: #ab34e9
}
博客底部左侧信息如下
<div class="github-badge">
<a href="#" title="©2018-2020">
<span class="badge-subject">Copyright</span><span class="badge-value bg-blue">©2018-2020</span>
</a></div>
| <div class="github-badge"><a href="/sitemap.xml" target="_blank"><span class="badge-subject">SiteMap</span><span class="badge-value bg-blue">站点地图</span></a></div>
博客底部右侧信息如下
<div class="github-badge">
<a href="http://www.typecho.org" target="_blank" title="由 Typecho 强力驱动">
<span class="badge-subject">Powered</span><span class="badge-value bg-blue">Typecho</span>
</a>
</div>
|
<div class="github-badge">
<a href="https://www.ihewro.com/archives/489/" target="_blank" title="站点使用 handsome 主题,作者:友人C">
<span class="badge-subject">Theme</span><span class="badge-value bg-orange">Handsome</span>
</a>
</div>
修改handsome/component/footer.php
<div class="wrapper bg-light">
<span class="pull-right hidden-xs text-ellipsis">
<?php $this->options->BottomInfo(); ?>
</span>
<span class="text-ellipsis"><?php
$this->options->BottomleftInfo(); ?></span>
</div>
<!--可以去除主题版权信息,最好保留版权信息或者添加主题信息到友链,谢谢你的理解-->
评论通知
邮件通知
邮件通知基于如下插件
详情参照这篇文章
微信通知
微信通知基于如下插件
UserAgent
滑稽表情包
- 复制owo.json到
handsome/usr/
- 复制paopao文件夹到
handsome/usr/img/emotion/
- 清除一下游览器缓存,然后刷新即可
响应耗时和访客统计
functions.php
文件进行了加密
因此我们将修改放在
handsome/libs/Content.php
中
修改Content.php
起始处为
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* 访问总量
*/
function theAllViews(){
$db = Typecho_Db::get();
$row = $db->fetchAll('SELECT SUM(VIEWS) FROM `typecho_contents`');
echo number_format($row[0]['SUM(VIEWS)']);
}
/**
* 响应时间
*/
function timer_start() {
global $timestart;
$mtime = explode( ' ', microtime() );
$timestart = $mtime[1] + $mtime[0];
return true;
}
timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
global $timestart, $timeend;
$mtime = explode( ' ', microtime() );
$timeend = $mtime[1] + $mtime[0];
$timetotal = number_format( $timeend - $timestart, $precision );
$r = $timetotal < 1 ? $timetotal * 1000 . " ms" : $timetotal . " s";
if ( $display ) {
echo $r;
}
return $r;
}
/**
* Content.php
* Author : hewro
* Date : 2017/05/21
* Version : 1.0.0
* Description: 使用PHP方法输出内容
*/
然后修改component/sidebar.php
,在大约100行左右,最后活动
处的</li>
标签之后添加如下代码
<li class="list-group-item text-second"> <i class="glyphicon glyphicon-user text-muted"></i> <span class="badge
pull-right"><?php echo theAllViews();?></span><?php _me("访客总数") ?></li>
<li class="list-group-item text-second"> <i class="glyphicon glyphicon-time text-muted"></i> <span class="badge
pull-right"><?php echo timer_stop();?></span><?php _me("响应耗时") ?></li>
首页文章同时显示浏览数和评论数
默认是不显示浏览数的,只有评论数
打开handsome/libs/Content.php
第1100~1200行左右
找到如下代码
<span class="m-r-sm right-small-icons"><i data-feather="user"></i></span><a href="{$parameterArray['authorUrl']}">{$parameterArray['author']}</a></li>
<li><span class="right-small-icons m-r-sm"><i data-feather="clock"></i></span>{$dateString}</li>
// 下面添加这行代码
<i class="fontello fontello-eye text-muted"></i> {$viewNumString}
添加心知天气
心知天气
,地址:https://www.seniverse.com/widget 进入后配置好内容,然后点击下方的生成代码
打开handsome/component/headnav.php
,在57行左右
<a href="" style="display: none" id="searchUrl"></a>
<!-- / search form -->
<!-- 在这之后添加心知天气生成的结果 -->
将 <div id="tp-weather-widget">
改成 <div id="tp-weather-widget" class="navbar-form navbar-form-sm navbar-left shift">
修改主题播放器音量
这里通过在主题后台自定义js脚本中添加以下代码实现
window.onload = function() {
setTimeout(() => {
document.querySelector('.skPlayer-source').volume = 0.3;
}, 3000);
}
问题
如果底部footer栏和右侧sidebar栏有重合
修改
handsome.min.css
文件
.wrapper{padding: 15px;}
修改为
.wrapper{padding: 11px;}
如果希望右侧sidebar栏有透明底色并且悬浮不透明
修改插件
KirinShiKi/css/kirin.css
文件
第 188 行
aside.col.w-md.no-border-xs {
transition:all .3s;
opacity: 0.9 !important;
}
aside.col.w-md.no-border-xs:hover {
opacity: 1 !important;
}
参考
版权属于:ajycc20
本文链接:https://ajycc20.top/archives/12.html
所有原创文章采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。 您可以自由的转载和修改,但请务必注明文章来源并且不可用于商业目的。