Hexo 博客技巧:添加自定义 html 页面
前言以前收集了很多有趣的 html 特效文件,自己也写过不少,但是这些文件都有一个缺点:只能本地浏览。
很早以前就有一个想法,就是将这些文件部署到网站上供人们随时随地浏览,只是一直没能实现。现在有了自己的博客,正好实现完成这个想法。
具体过程
首先在博客根目录的 source 文件夹下,新建一个文件夹用于存放要部署的 HTML 文件:
我这里建了一个叫 HTML 的文件夹,里面的子文件夹可以存放各个 HTML 文件,当然也可以只创建一个主文件夹,直接在里面放 HTML 文件。
然后在博客根目录的配置文件_config.yml 文件里,设置跳过渲染:
单个文件,就写:
123# 跳过渲染skip_render: - "xxxx.html"
如果只创建了一个文件夹,要跳过它目录下所有文件的渲染,就写:
123# 跳过文件夹下所有文件skip_render: - "文件夹名/*"
如果父文件夹下还有子文件夹,就写:
123# 跳过子文件夹skip_render: - "文件夹名/子文件夹名/*"
...
Hexo Butterfly主题美化
代码样式
代码块中的所有功能只适用于 Hexo 自带的代码渲染。如果使用第三方的渲染器,不一定会有效
代码高亮主题Butterfly 支持 6 种代码高亮样式:
darker
pale night
light
ocean
mac
mac light
修改主题配置文件 _config.butterfly.yml
1highlight_theme: mac
代码复制主题支持代码复製功能
修改 主题配置文件
1highlight_copy: true
代码高度限制
3.7.0 及以上支持
顶部图
配置
解释
index_img
主页的 top_img
default_top_img
默认的 top_img,当页面的 top_img 没有配置时,会显示 default_top_img
archive_img
归档页面的 top_img
tag_img
tag 子页面 的 默认 top_img
tag_per_img
tag 子页面的 top_img,可配置每个 tag 的 top_img
category_img
category 子页面 的 默认 t ...
Hexo+GitHub 搭建个人博客
准备工作安装必要的软件
Node.jshttps://nodejs.org/en/
Windows:通过 nvs(推荐)或者 nvm 安装。
Mac:使用 Homebrew 或 MacPorts 安装。
Linux(DEB/RPM-based):从 NodeSource 安装。
其它:使用相应的软件包管理器进行安装,可以参考由 Node.js 提供的 指导。
githttps://git-scm.com/
Windows:下载并安装 git.
Mac:使用 Homebrew, MacPorts 或者下载 安装程序。
Linux (Ubuntu, Debian):sudo apt-get install git-core
Linux (Fedora, Red Hat, CentOS):sudo yum install git-core
安装 Hexo官方网址: https://hexo.io/zh-cn/
首先需要建立博客文件夹,建议建在非系统盘,例如 ~E:/Hexo/,那么这个目录就是我们博客的根目录了。因为每个人的命名习惯不同,本帖之后会以 [Blogroot] ...