Hexo 简介
Hexo 官网
hexo 原理分析
Hexo 基础配置
node.js 下载
1 2 3 4 5 6 7
| npm install -g hexo-cli npm install hexo
C:\Users\scfan\AppData\Roaming\npm\node_modules\hexo\bin
配置之后重新打开 gitbash, 则会有 hexo 命令
|
Hexo 博客配置
折叠隐藏部分文字
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <details> <summary>隐藏内容的标题</summary>
- 支持MarkDown语法 - 支持代码块等等
```python import os ``` // 防止排版错误:因为这是代码块内的代码。使用时可删除
- 支持表格
|文字|文字| |-|-| |文字|文字|
</details>
|
隐藏内容的标题
支持 MarkDown 语法
支持代码块等等
支持表格
Hexo 博客如何折叠(显示/隐藏)部分文字
添加文章创建时间和更新时间
本博客采用更新时间 modified 。 创建时间 date
配置方法详见如下
配置自动更新时间 themes\next\layout\_macro\post.swig
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| {% if post.top %} <i class="fa fa-thumb-tack"></i> <font color="#F05050">[置顶]</font> <span class="post-meta-divider">|</span> {% endif %} <span class="post-time"> {% if theme.post_meta.created_at %} <span class="post-meta-item-icon"> <i class="fa fa-calendar-o"></i> </span> {% if theme.post_meta.item_text %} <span class="post-meta-item-text">{{ __('post.posted') }}</span> {% endif %} <time title="{{ __('post.created') }}" itemprop="dateCreated datePublished" datetime="{{ moment(post.date).format() }}"> {{ date(post.date, config.date_format) }} </time> {% endif %}
{% if theme.post_meta.created_at and theme.post_meta.updated_at %} <span class="post-meta-divider">|</span> {% endif %}
{% if theme.post_meta.updated_at %} <span class="post-meta-item-icon"> <i class="fa fa-calendar-check-o"></i> </span> {% if theme.post_meta.item_text %} <span class="post-meta-item-text">{{ __('post.modified') }}:</span> {% endif %} <time title="{{ __('post.modified') }}" itemprop="dateModified" datetime="{{ moment(post.updated).format() }}"> {{ date(post.updated, config.date_format) }} </time> {% endif %} </span>
|
配置文章展示项 themes\next\_config.yml
1 2 3 4 5 6
| post_meta: item_text: true created_at: true updated_at: true categories: true
|
配置展示的名称 themes\next\languages\zh-Hans.yml
1 2 3 4 5
| post: created: 创建于 modified: 更新于 sticky: 置顶 posted: 发表于
|
参考链接
修改文章 URL 生成方式
1 2 3 4
|
permalink: :url_path/
|
个人博客绑定域名配置
博客评论配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| {% elseif theme.gitalk.enable %} <div class="comments" id="comments"> <div id="gitalk-container"></div> </div>
gitalk: enable: true ClientID: xxxxx ClientSecret: xxxxxx repo: fansichao.github.io owner: fansichao adminUser: fansichao IdPrefix: labels: comments perPage: 10 pagerDirection: last createIssueManually: false distractionFreeMode: false enableHotKey: true
|
配置详见 Gittalk-github 参考
设置博客置顶
配置私密博客 hexo-hide-posts
效果:博客在首页会被隐藏,实际通过链接仍可以访问
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
hide_posts: filter: hidden public_generators: [] noindex: true
hidden: true
hexo hidden:list
|
hexo-hide-posts
配置 看板娘
看板娘 hexo-helper-live2d
华丽的看板娘 live2d-widget
配置 hexo-related-popular-posts
生成到相关帖子或热门帖子的链接列表。
1 2 3 4 5 6 7 8 9 10
| <!-- hexo-related-popular-posts --> {% if not is_index %} <h3>相关文章</h3> {{ popular_posts({ maxCount: 10 , ulClass: 'popular-posts' , PPMixingRate: 0.0 , isImage: false, isDate: false, isExcerpt: false} , post) }} {% endif %}
https://github.com/tea3/hexo-related-popular-posts/issues/4
|
hexo-related-popular-posts
支持 标签的大小写、空格、下划线等统一
hexo-easy-tags-plugin
hexo-permalink-pinyin
可将中文标题转换为音译的永久链接。
hexo-permalink-pinyin
hexo-notify
Hexo 的通知插件。
hexo-notify
hexo-seo-link-visualizer
TODO 未成功
分析链接并可视化 Hexo 的站点结构。
hexo-seo-link-visualizer
hexo-encrypt
文章加密
TODO 可用, 但是未显示加密页面
hexo-encrypt
Resources
适合做笔记的博客主题