1.Windows环境配置
Pandoc https://pandoc.org/
2.安装Hexo
1 | npm config set registry https://registry.npmmirror.com |
3.Github仓库
在你的github中新建仓库“username.github.io”,其中,username就是你注册时使用的用户名。
修改你博客根目录下的_config.yml文件中的deploy配置项:
1 | deploy: |
他会在你的仓库的gh-pages分支部署你的页面,然后再master分支保存你网站的源代码,不会相互覆盖。
通过如下代码进行部署:
1 | hexo clean # 清除缓存 |
然后就可以在浏览器上输入http://username.github.io访问你的博客了。
4.Github保存源码
1 | git init |
设置.gitignore
1 | .DS_Store |
再上GitHub设置master为主分支,删除main分支,以gh-pages分支部署Github Pages
5.主题
https://github.com/saicaca/hexo-theme-vivia
1 | npm install hexo-theme-vivia |
编辑_config.yml
添加:
1 | archive_generator: |
6.LaTex公式
https://github.com/next-theme/hexo-filter-mathjax
https://github.com/hexojs/hexo-renderer-pandoc
1 | npm install hexo-filter-mathjax |
配置_config.yml:
1 | mathjax: |
本地电脑安装配置Pandoc后:
1 | npm uninstall hexo-renderer-marked |
7.图床
不重复造轮子,这篇知乎写得非常好了:
https://zhuanlan.zhihu.com/p/112912928
8.写作
1 | hexo new "[部署]hexo博客 & Github Pages部署记录" |
新电脑写作
基本工作nodejs+git+pandoc,GitHub仓库上添加ssh公钥,在新电脑执行:
1 | ssh-keygen -t rsa |
克隆项目:
1 | git clone git@github.com:fengwm64/fengwm64.github.io.git |
若npm install失败,管理员开启powershell
1 | set-ExecutionPolicy RemoteSigned |
验证:
1 | hexo -V |
重复 写作 部分