-
Notifications
You must be signed in to change notification settings - Fork 0
Home
IDKHTS edited this page Apr 4, 2021
·
2 revisions
hexo官方文档
安装后,hexo init初始化hexo,修改配置里的目的GitHub仓库,即可
新建文章:hexo new [title]会在hexo目录(hexo init的目录)下的/source/_post/生成title.md文件,md文件即文章
写作:直接编写md文件
配置:在hexo目录下的._config.yml文件配置
- post_asset_folder: true 配置新建文章时同时在同目录下建立同名文件夹存放图片,文章引用写相对路径即可
- theme:themeName 配置主题,themeName主题名称,主题从GitHub上克隆到hexo目录下的themes文件夹下即可,找主题
- 部署相关,repo写作为博客的仓库,使用GitHubPages时,【注意】:仓库的名称必须为userName.github.io
deploy:
type: 'git'
repo: 'git@github.com:IDKHTS/idkhts.github.io.git'
编译md文章为html:hexo generate(简写hexo g)生成一些html文件
启动本地服务浏览编译后md文章:hexo server一般是访问http://localhost:4000/
部署:hexo deploy也即把文章推到GitHub上,GithubPage显示
清除缓存:hexo clean也即把之前编译后的文章文件删除,常用