注:使用fluid主题
hexo满足的语法相对局限,尽量不在hexo插入过多公式,以随笔为主。
撰写md文件
markdown文件编辑器:obsidian
Note
图片放在与文件同名的文件夹下,同时传入。通过obsidian插件custom attachment location实现对图片地址的格式与hexo语法要求统一。### 在内容的上方加入front-matters
---
title:
author: Henry Zhang
tags:
-
index_img: /img/.jpg
banner_img: /img/.jpg
date:2024-06-26 02:23:40
comment: 'valine'
sticky: 900
---
Warning
- 在tags部分可能会报错注意修改。
- 如果在obsidian里front-matters显示红色,说明有问题,需要修改。
- 可以在obsdian中以阅读视图对front-matters进行可视化修改。
- 文档内的图片直接复制粘贴到与文章同名目录下即可,banner_img和index_img如果要显示的话需要放在img目录下。
清除缓存
hexo clean
Warning
使用的是git bash,而不是cmd。注意打开的路径要切到文件夹my_blog_file内。
生成并部署
hexo g -d
Warning
此处由于网络对github的链接问题,容易失败,需要耐心与反复尝试。 如果实在难以解决,删除gitdeploy文件夹,之后执行
git config --global core.autocrlf false hexo clean hexo g -d
本地服务器测试
hexo s
Hexo的其他的博客操作补充笔记
在hexo博客中插入一行多张的图片方式(推荐)
{% gi total 2-2-... %}





{% endgi %}
其中2-2-…表示第几行并置几张图片。
在hexo博客中也可以通过表格的方式插入一行多张的图片方式
|  |  |  |
| --- | ---| --- |
在hexo博客中使用tag
在 markdown 中加入如下的代码来使用便签:
{% note success %}
文字 或者 `markdown` 均可
{% endnote %}
或者使用 HTML 形式:
<p class="note note-success">标签</p>
使用时 {% note primary %} 和 {% endnote %} 需单独一行,否则会出现问题。
sucess对应的是绿色,还有其他可选颜色。
primary-紫色
danger-红色
info-蓝色
warning-黄色等