handsome神代綺凜式魔改主题插件KirinShiKi

  • 网页标题卖萌文字。
  • 赞赏按钮跳动效果。
  • 美化首页文章头图样式。
  • 博客主头像悬浮旋转效果。
  • 顶栏左侧边栏模式切换开关。
  • 可以设置背景图片
  • 右侧边栏自动隐藏

作者Sanake博文详情
GitHub下载地址

typecho一款萌萌的返回顶部插件MoeTop

返回顶部.png

  • 支持上面5种图片模型
  • 支持随机模式
  • 支持移动端显示

作者Sanake博文详情
GitHub下载地址

Typecho炫彩鼠标插件:HoerMouse

  • 支持文字气泡效果
  • 支持爱心气泡效果
  • 支持fireworks+anime喷墨气泡效果
  • 支持自定义气泡颜色和速度
  • 修改鼠标样式

作者Hoe博文详情
gitee下载地址

文章末尾版权信息插件Copyright

  • 设置文章与独立页面的版权声明
  • 自动生成本文末尾的版权信息

作者Sanake博文详情
GitHub下载地址

修改网站底部

  • 将以下代码添加至后台控制台-->设置外观-->开发者设置里的自定义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="©2016-2019&nbsp;">
        <span class="badge-subject">Copyright</span><span class="badge-value bg-blue">©2016-2019&nbsp;</span>
    </a>
</div>
&nbsp;|&nbsp;
<div class="github-badge">
    <a href="./" title="Sanakey">
    <span class="badge-subject">By</span><span class="badge-value bg-green">Sanakey</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>
&nbsp;|&nbsp; 
<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>
&nbsp;|&nbsp; 
<div class="github-badge">
    <a href="https://moe.best/" target="_blank" title="handsome主题由JindaiKirin魔改">
        <span class="badge-subject">Modified</span><span class="badge-value bg-red">JindaiKirin</span>
    </a>
</div>
  • 删除handsome/component/footer.php中的部分代码
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php Content::outputCommentJS($this, $this->security); ?>
</div><!-- /content -->
  <footer id="footer" class="app-footer" role="footer">
    <div class="wrapper b-t bg-light">
      <span class="pull-right hidden-xs text-ellipsis">
      <?php $this->options->BottomInfo(); ?>
      <!-- Powered by <a target="blank" href="http://www.typecho.org">Typecho</a>&nbsp;|&nbsp;Theme by <a target="blank" href="https://www.ihewro.com/archives/489/">handsome</a> 删除本行-->
      </span>
        <span class="text-ellipsis">
        <!-- &copy;&nbsp;<?php echo date("Y");?> Copyright&nbsp; 删除本行-->
            <?php $this->options->BottomleftInfo(); ?></span>
    </div>

添加访客总数和响应耗时

CoolCrush博文详情

  • 添加PHP代码到themes/handsome/libs/Content.php中,放在class Content{}之前。
    /**
     * 访问总量
     */
     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;
    }
  • 编辑themes/handsome/component/sidebar.php文件,在代码的100-120行左右或者CTRL+F搜索运行天数,在ul标签中添加显示访客总数和响应耗时代码.
<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>

代码高亮插件CodePrettify

作者Xcnte博文详情
GitHub下载地址
需要修改(替换)/usr/themes/handsome/assets/css/下的handsome.min.css文件
Handsome 6.0.0 版本handsome.min.css文件下载

  • 主题-->设置外观-->Pjax-->PJAX回调函数增加以下代码
if (typeof Prism !== 'undefined') {
var pres = document.getElementsByTagName('pre');
                for (var i = 0; i < pres.length; i++){
                    if (pres[i].getElementsByTagName('code').length > 0)
                        pres[i].className  = 'line-numbers';}
Prism.highlightAll(true,null);}
Last modification:March 20th, 2021 at 01:48 pm
如果觉得我的文章对你有用,请随意赞赏