使用Hexo+Github搭建免费个人博客过程记录

虽然n久没有用GitHub了,记录一下个人博客怎么弄

安装前提

安装 Hexo 相当简单,只需要先安装下列应用程序即可:
Node.js (安装最新版本即可,npm也一块装好了)npm -v测试
Git

前期准备-创建repo、配置SSH

https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html

使用hexo写博客上传

创建一个放置博客文件的文件夹
npm install -g hexo
npm install -g hexo-cli
npm install hexo-server --save
hexo init blog

常见命令

hexo new "postName" #新建文章
hexo new page "pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #部署到GitHub
hexo help  # 查看帮助
hexo version  #查看Hexo的版本

目前就是每次写好md文件 复制到source\_posts文件夹中
然后
hexo g -c
hexo s
hexo d
然后刷新个几次就会更新了!
样式都是默认的 有点那啥
一般写好的博客md文件在source文件夹中
每次可以新建文章后再部署到Github
更换主题:
https://github.com/sanjinhub/hexo-theme-geek
https://github.com/JoeyBling/hexo-theme-yilia-plus
https://hexo.io/themes/
https://zhuanlan.zhihu.com/p/137338730
https://github.com/fluid-dev/hexo-theme-fluid

推荐这个主题hexo-theme-fluid
https://hexo.fluid-dev.com/docs/start/

posted @ 2023-03-08 23:25  icydengyw  阅读(28)  评论(0编辑  收藏  举报