搭建&美化博客(基于hexo框架)
搭建过程
- nodejs下载安装(npm包管理器)
使用淘宝安装源镜像:>npm install -g cnpm –registry=https://registry.npm.taobao.org
使用cnpm安装hexo博客框架:>cnpm install -g hexo-cli - 使用hexo搭建博客
初始化博客:>hexo init
启动博客:>hexo s
新建博客:>hexo n “我的博客文章”
重新生成:>hexo g - 将博客部署至github
使用UU加速器打开github
新建仓库:仓库名是 “昵称.github.io”
安装部署至git的插件:>cnpm install –save hexo-deployer-git
修改配置文件_config.yml:
部署至远端:>hexo d
特别注意:由于GitHub近期的改动,配置文件_config.yml中的branch应该是main而不是master。参考资料1于2019年发布,已经过时,参考资料2对此进行了更新。
美化过程
使用主题:stun
github仓库:https://github.com/liuyib/hexo-theme-stun
hexo-theme-stun官方中文手册:https://theme-stun.github.io/docs/zh-CN/