JavaWeb软件开发好文选

完全免费搭建个人博客系列教程(二)

2019-01-05  本文已影响5人  不知名码农

使用hexo+github/coding免费搭建个人博客,本文记录hexo博客的一些个性化配置。包括:

个性化配置

修改主题

下载next主题,完成后,修改站点配置文件的 theme: landscape 为 theme: next,然后执行 hexo s 预览

git clone https://github.com/iissnan/hexo-theme-next themes/next`

增加头像并加旋转特效

增加统计字数、阅读时长

在主题配置文件themes/next/_config.yml中找到以下内容:将wordcount、min2read修改为true

post_wordcount:
item_text:  true
wordcount:  true
min2read:  true
totalcount:  true
separated_meta:  true

本地完成以上配置之后还需要增加 hexo-wordcount插件,在命令行中执行以下命令:

npm i --save hexo-wordcount`

安装完毕之后,就可以预览了效果了。自定义样式,如 字数统计:***修改为 字数统计:***字,在themes/next/layout/_macro/post.swig中找到以下内容

<span  title="{{ __('post.wordcount') }}">
{{ wordcount(post.content) }}
</span>

修改为

<span  title="{{ __('post.wordcount') }}">
{{ wordcount(post.content) }} 字
</span>

阅读时长:***修改为 阅读时长:***分钟

<span  title="{{ __('post.min2read') }}">`
{{ min2read(post.content) }}`
</span>

修改为

<span  title="{{ __('post.min2read') }}">
{{ min2read(post.content) }} 分钟
</span>

即可。

hexo增加七牛云图床及上传

参考自: 使用VSCode+七牛云图床插件+自定义快捷键配置Hexo博文编写环境

工具:

这个是我的微信公众号,会不定期更新,欢迎交流~~


weyoung.jpg
上一篇下一篇

猜你喜欢

热点阅读