Hexo 主题: hexo-theme-easy

2019-09-20 10:34:16 +08:00
 such

一个清爽的 hexo theme,高度配置化,简单高效,个人博客也在用自己的这个主题,项目地址在这里,欢迎 star~

个人之前的 blog,在去年还是前年的时候,从 wordpress 迁移到hexo。( PS:wordpress 简直是太慢太慢了,静态页的博客个人觉得就足够)期间,折腾过不少主题,用过nextindigo等,但是总觉得样式不够美观,就参考了部分主题,自己搞一个,后来自用了一段时间,想分享出来,欢迎吐槽。

Feature

截止到目前为止,主题内集成了下列这些功能,都是即插即用,可以根据自己的需求来。

安装

$ cd hexo (hexo main directory)
$ git clone https://github.com/8090lambert/hexo-theme-easy.git themes/easy

配置文件

$ vi themes/easy/_config.yml

菜单

集成了 font-awesome,在菜单可以选择 文本Icon:

# Header Menu
menu:
  Home: /
  Archives: /archives
  Email: mailto:<juzs215@gmail.com>
  # change github values to your own addresses
  Github:
    url: https://github.com/8090Lambert
    icon: github

首页封面图

# URL of the Home page image, For example:
# index_cover: /img/default-banner.jpg
# index_cover: http://8090lambert.cn/img/default-banner.jpg
index_cover: /img/default-banner.jpg

文章摘要

默认 200 字

# Use post content to trim portion text.
auto_excerpt:
  enable: true 
  length: 200   # trim length, default 200

文章 MetaData

依赖hexo-wordcount,需要提前安装: $ cd hexo_dict && npm install hexo-wordcount --save

# Post meta display settings
post_meta:
  item_text: true
  created_at: true
  updated_at: true
  categories: true

# Post wordcount display settings
# Dependencies: https://github.com/willin/hexo-wordcount
post_wordcount:
  item_text: true
  wordcount: true
  min2read: false
  totalcount: false
  separated_meta: true

评论系统

选择一个要使用的平台,申请对应的 appid & appkey (不允许同时开启多个)

# Many Comment Drivers, you can choose one to open it.
# Write your configure of which platform.

# disqus
disqus_shortname: false

# uyan
uyan_uid: false

# Gitment,https://github.com/imsun/gitment
gitment:
  enable: false
  owner: 
  repo: 
  client_id: 
  client_secret: 

# Gitalk,
gitalk:
  enable: false
  owner: 
  repo: 
  admin: 
  client_id: 
  client_secret: 

# Valine Comment system. https://valine.js.org
valine:
  enable: false
  appId:  # your leancloud appId
  appKey:  # your leancloud appKey
  notify: false # Mail notify
  verify: false # Verify code
  avatar: mm # Gravatar style : mm/identicon/monsterid/wavatar/retro/hide
  placeholder: Just go go # Comment Box placeholder
  guest_info: nick,mail,link # Comment header info
  pageSize: 10 # comment list page size

# Hyper Comments support. Write your id here, or false to disable. http://hypercomments.com
hyper_id: false

页脚

# Footer setting.
footer:
  # Specify the date when the site was setup.
  # If not defined, current year will be used.
  since: 2016

  # Icon between year and copyright info.
  icon: heart

  # If not defined, will be used `author` from Hexo main config.
  copyright: 8090Lambert

  # Hexo link (Powered by Hexo).
  powered: false

全站 PV 统计

# Show PV/UV of the website/page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
  # count values only if the other configs are false
  enable: true

统计 & 分析

根据自己需要去开启,可以同时启用多个

# Google Analytics Write your tracking id here, or false to disable.s
google_analytics: 
google_site_verification: 

# CNZZ
cnzz: false

# BaiDu Analytics
baidu_tongji: false

# Sougou Verification.
sogou_site_verification: false

Ok,Enjoy yourself 😀

4306 次点击
所在节点    前端开发
18 条回复
JackieMe
2019-09-20 11:02:29 +08:00
作为不会写主题的小白,我现在根本不敢用大家自己写的主题的,因为没几天就弃坑,然后后续软件升级参数变了主题就挂了。前面试过也是在 V2 发的 Hugo 主题,好几个都是发帖之后 commit 一次都没有,后来 Hugo 更新了主题就一直报错了。所以现在只敢用那些稍微大众的而且有长期维护的。
kokdemo
2019-09-20 11:06:18 +08:00
@JackieMe hugo 还是比较稳定吧?
ipwx
2019-09-20 11:08:53 +08:00
wow,这主题着实不错
JackieMe
2019-09-20 11:14:25 +08:00
@kokdemo Hugo 现在都是 0.5x 版本啊,最近 58 好像就变了很多参数名称。
such
2019-09-20 15:14:24 +08:00
@ipwx 感谢
such
2019-09-20 15:26:35 +08:00
@JackieMe 一起参与共建,其实跑路就是因为本身项目关注度较少,作者没有动力去维护
kneep
2019-09-20 15:54:10 +08:00
除了 next 以外,感觉不跑路的很少
MonoLogueChi
2019-09-20 18:06:01 +08:00
问个无关的问题,为什么大部分 hexo 主题的安装方式都是推荐用 git clone
JackieMe
2019-09-20 19:42:18 +08:00
@MonoLogueChi 方便以后直接 git fetch 更新?
shanlan
2019-09-20 20:10:05 +08:00
比较喜欢 pure 的主题,你这种主题虽然简洁,但是浪费了太多的宝贵界面。
such
2019-09-20 22:12:29 +08:00
@kneep 还是关注度,贡献的问题
such
2019-09-20 22:19:42 +08:00
@shanlan 个人喜好的问题,无关紧要的。谈不上浪费,整个风格就是这样
such
2019-09-20 22:41:22 +08:00
@MonoLogueChi 哈哈,方便快捷
MonoLogueChi
2019-09-21 10:12:27 +08:00
@JackieMe @such 那为什么不带上参数 -b 和--depth 呢? clone 完整的仓库也没用啊。感觉这种方式安装会带一堆没用的东西进来
such
2019-09-21 18:57:16 +08:00
没有必要啊,而且假使有多版本支持呢,或者说,你愿意经常切换版本使用呢。至于 depth,本身良好的 git flow 和指定 depth 有多大差距
xrr2016
2019-09-23 18:53:25 +08:00
我晕,我的博客安装 busuanzi 后一直报 400 Bad Request 错误,没法统计数据...心累
such
2019-09-30 20:04:10 +08:00
@xrr2016 请问是用的这个主题吗
xrr2016
2019-09-30 23:13:10 +08:00
@such 额,不是,是我自己的主题,很郁闷😒

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/602429

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX