折腾了几天,一款至简的 hexo 主题

一个清爽的 hexo theme,高度配置化,简单高效

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

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 :grinning:

本作品采用《CC 协议》,转载必须注明作者和本文链接
8090lambert
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
讨论数量: 4
cnguu

一开始我也是想自己开发一个 Hexo 主题,后来发现其中的技术不适合工作需要,所以现在我在开发 VuePress 主题,毕竟 Vue 才是主流

4年前 评论

@cnguu 看中 hexo 的便捷,丰富的api,个人觉得够用就好。喜欢折腾这方面的,确实 VuePress 会更合适一点

4年前 评论
cnguu 4年前
Epona

膜拜大佬!

4年前 评论

膜拜大佬!

4年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!