环境要求
安装Hexo-cli
npm install hexo-cli -g
创建Blog项目
hexo init blogname
安装包
npm install
支持Latex
安装hexo-math
npm install hexo-math -S
修改配置文件
在root目录的_config.yml添加设置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| math: engine: 'mathjax' # or 'katex' mathjax: src: "//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" config: # MathJax config tex2jax: inlineMath: [ ['$','$'], ["\\(","\\)"] ] skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] processEscapes: true TeX: equationNumbers: autoNumber: "AMS" katex: css: "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css" js: "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.js" # not used config: # KaTeX config throwOnError: false errorColor: "#cc0000"
|
安装主题
克隆主题库
git clone git@xxx themes/name
修改主题
修改root目录下_config.yml
常用操作
新建文章
hexo new name
开启服务
hexo s
部署
hexo d -g