hexo-theme-next @modified LRH

hexo-theme-next

基于hexo-theme-next 6.0+的Pisces模板做的DIY扩展性设计。主要是一些custom stlye还有一些第三方的js。修改的地方太多也有点小乱就不提PR了。 官方Demo => https://theme-next.org
记录一下折腾过程,修改内容以博採眾長为准,以后备份恢复博客也好方便自己。本文之前的美化修改请见hexo分类
主题中若有遗漏第三方插件或应用的key及id值等请修改为自己对应的值

主要的几个自定义文件

_config.swig         #主题配置文件 相关账户信息自己注册替换
\layout\custom\head.swig      #在头部自定义加入标签
\layout\custom\google_adsense.swig    #谷歌广告模块,内有注释暂时弃用
\layout\_layout.swig        #主布局
\layout\_macro\post.swig      #文章布局
\layout\_macro\post-copyright.swig    #文章版权
\layout\_macro\siderbar.swig      #侧栏模板
\layout\_third-party\copy-code.swig   #复制按钮
\layout\_partials\comments.swig     #评论主模板
\layout\_partials\footer.swig     #底部模板
\layout\_third-party\custom.swig      #该模块在layout.swig引入用于在body自定义标签
\source\css\_custom\customs.styl    #主要用户自定义样式表
\source\fonts\          #引入了一些我的手写体及外部字体
\scripts\qcloudcdn.js       #腾讯云cos桶刷新缓存的脚本,不需要可删掉[^1]
\layout\_partials\footer_custom.swig    #footer自定义文件

^1

初步安装

cd hexo
git clone https://github.com/Lruihao/hexo-theme-next themes/next

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-D03XVRdM-1633447886756)(https://i.loli.net/2019/04/03/5ca471ec93167.png)]

更新内容

更多自定义详见源码

备案信息自定义

# -------------------------------------------------------------
# footer_custom Settings
# ---------------------------------------------------------------
beian:
  enable: true
  gov: 湘公网安备 43030402000254号
  recordcode: 43030402000254
  icp: 湘ICP备18020535号

文字抖动特效

<div class="shaky">(づ●'◡'●)づ ❥内容区</div>

左下角微信公众号

\source\css\_custom\customs.styl  

相关文章收纳

加入H5标签,实现可收纳功能,点击查看详情。

Chat Services

共chatra,tidio,daovoice三个选项,三选一

# Chatra Support
# See: https://chatra.io
# Dashboard: https://app.chatra.io/settings/general
chatra:
  enable: false
  async: true
  id: # visit Dashboard to get your ChatraID
  #embed: # unfinished experimental feature for developers, See: https://chatra.io/help/api/#injectto

# Tidio Support
# See: https://www.tidiochat.com
# Dashboard: https://www.tidiochat.com/panel/dashboard
tidio:
  enable: false
  key: # Public Key, get it from Dashboard, See: https://www.tidiochat.com/panel/settings/developer

#在线客服
daovoice: true
daovoice_app_id: xxxx   # http://www.daovoice.io/

pdf和Mermaid解析模块

pdf传送门

pdf:
  enable: false
  # Default height
  height: 500px
  pdfobject:
    cdn: //cdn.jsdelivr.net/npm/pdfobject@2/pdfobject.min.js
    #cdn: //cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js

# Mermaid tag
mermaid:
  enable: false
  # Available themes: default | dark | forest | neutral
  theme: forest
  cdn: //cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
  #cdn: //cdnjs.cloudflare.com/ajax/libs/mermaid/8.0.0/mermaid.min.js

模仿csdn转发样式

...
   <a class="post-title-link" href="{{ url_for(post.path) }}" itemprop="url">
+    {% if post.repost %}
+      <span class="repost">转</span>
+    {% endif %}
     {{ post.title | default(__('post.untitled'))}}
   </a>
 {% else -%}
+  {% if post.repost %}
+    <span class="repost">转</span>
+  {% endif %}
   {{- post.title -}}
...
.repost {
  color: #5acc79;
  border: 1px solid #e7f4df;
  border-radius: 20px;
  padding: 2px 5px;
  font-size: 15px;
  font-weight: 500;
}
---
title: xxxx
repost: true
---

预览

热度页面

打开hexo\themes\next\layout新建top.swig文件,写下如下内容保存:
其中第36行改成你自己的leancloud的appid和appkey,比如我的是在主题配置文件里面的valine配置下,所以我就写成theme.valine.appid。和我一样就不需要修改,其他自行配置。

然后hexo n page top新建一个页面文章配置写下如下内容,limit表示显示篇数:

---
title: 热度
layout: top
limit: 20
---

复制按钮样式

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7uaEaybj-1633447886757)(https://i.loli.net/2019/03/21/5c939bb23853d.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dh7BTyvU-1633447886757)(https://i.loli.net/2019/03/21/5c939bb229bad.png)]
flatbtn.png
3dbtn.png

本来只想简单美化一下变成night样式的,后来写完发现3dbtn也挺喜欢的。

codeblock:
  # Manual define the border radius in codeblock
  # Leave it empty for the default 1
  border_radius: 5
  # Add copy button on codeblock
  copy_button:
    enable: true
    # Show text copy result
    show_result: true
    # Style: 'light,night,flat,3dbtn' is currently available, leave it empty or light is default theme
    style: night

本文作者: 李瑞豪
修改时间: 2019-05-30 23:34:28
本文链接: https://lruihao.cn/posts/hexo-theme-next/
版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 4.0 许可协议。转载请注明出处!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值