环境:WSL-Ubuntu 24.04 LTS

hexo 自定义配置

公式渲染(已废弃)

pandoc发行页面获取下载连接。

1
2
3
4
npm un hexo-math
npm un hexo-renderer-marked
npm i hexo-renderer-pandoc
sudo apt-get install pandoc

_config.yml 添加配置。

1
2
3
4
5
6
math:
engine: 'mathjax' # or 'katex'
mathjax:
# src: custom_mathjax_source
config:
# MathJax config

自行修改主题的配置。

文章加密

1
npm install --save hexo-blog-encrypt

部署至个人服务器

1
2
npm install hexo-deployer-ftpsync --save    # 密码
npm install hexo-deployer-sftp --save # 密钥 ## 提示高风险漏洞。。。。

服务器权限设置过于严格,均失败。。。。。
转而使用 rsync

1
rsync -av -e 'ssh -C -p <port>' <source> <user>@<URL>:<target_root>

站点地图

1
npm install hexo-generator-sitemap --save

并向谷歌站长工具提交信息。
百度我懒得弄,总体大差不差,请自行搜索相关信息。

搜索配置

1
npm install hexo-generator-searchdb

添加 HEXO 配置,详情见官方页面。并在 butterfly 主题配置中设置为 local_search 。

1
2
3
4
5
search:
path: search.json
field: post
content: true
format: striptags

更换渲染引擎

1
2
3
4
5
6
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it-plus --save
npm install markdown-it-task-lists
npm install mdit-plugin-callouts
npm install hexo-filter-titlebased-link --save
npm install markdown-it-mathjax --save

配置文件添加

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# markdown_it_plus 语法渲染插件选项
markdown_it_plus:
plugins:
# 数学公式支持
- plugin:
name: '@iktakahiro/markdown-it-katex'
enable: false
- plugin:
name: '@andatoshiki/markdown-it-katex'
enable: true
# 任务列表语法 - [ ] / - [ x ]
- plugin:
name: markdown-it-task-lists
enable: true
options:
# Obsidian Callouts
- plugin:
name: mdit-plugin-callouts
enable: true

关系图谱

参考大佬文章Butterfly 侧边栏实现 Obsidian 关系图谱

  1. 安装 cosma

    1
    2
    # https://cosma.arthurperret.fr/installing.html
    npm install @graphlab-fr/cosma -g
  2. 安装 cosma