博客初始化
生成使用hexo,主题使用next。部署在github pages。
hexo
安装
安装nodejs,选择LTS版本
安装hexo:
1 | npm install hexo |
初始化
参考:建站
1 | hexo init <folder> |
基本配置
编辑模板:scaffolds/posts.md
:
1 |
|
文件名YYYYMMDD_title.md:_config.yml
1 | new_post_name: :year:month:day_:title.md # File name of new posts |
next
文档:Getting Started | NexT (theme-next.js.org)
安装
1 | cd <folder> |
配置
生效
_config.yml
:
1 | theme: next |
next配置文件初始化
需要建立文件_config.next.yml
,同时赋予默认值
1 | cp node_modules/hexo-theme-next/_config.yml _config.next.yml |
选择Genimi主题及暗黑风格
1 | scheme: Gemini |
显示tags
在_config.yml
禁止:
1 | tag_generator: |
新建tags页面:
1 | hexo new page tags |
修改tags页面source/tags/index.md
的type为tags
1 |
|
显示categories
新建categories页面:
1 | hexo new page categories |
修改categories页面source/categories/index.md
的type为categories
1 |
|
停止动画
_config.next.yml
:
1 | motion: |
备案号
_config.next.yml
:
1 | beian: |
since
_config.next.yml
:
1 | footer: |
部署
参考:在 GitHub Pages 上部署 Hexo | Hexo
自定义域名
添加文件:source/CNAME
:
1 | www.mytips.cn |
GitHub Actions
添加文件:.github/workflows/pages.yml
:
1 | name: Pages |