这是我发的第一篇博客,以此证明我在这个世上存在过……

如何发表文章

安装hexo渲染器

1
npm install hexo-renderer-pug hexo-renderer-stylus

由于公式原因,需要更换渲染器里的东西,开启KaTeX 需要把 use 设置为 katex

1
2
3
katex:
# Enable the copy KaTeX formula
copy_tex: false

你不需要添加 katex.min.js 來渲染数学方程。相应的你需要卸載你之前的 hexo 的 markdown 渲染器,然后安装其它插件。

1
2
3
4
5
npm un hexo-renderer-marked --save # 如果有安装这个的话,卸载
npm un hexo-renderer-kramed --save # 如果有安装这个的话,卸载

npm i hexo-renderer-markdown-it --save # 需要安装这个渲染插件
npm install katex @renbaoshuo/markdown-it-katex #需要安装这个katex插件

在 hexo 的根目录的 _config.yml 中配置

1
2
3
markdown:
plugins:
- '@renbaoshuo/markdown-it-katex'

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment