所谓博客,都是孤芳自赏 nMask’s Blog
所需环境
全局安装 hexo
npm install hexo-cli -g
新建项目
hexo init blog
cd blog
npm install
运行
hexo s
此时打开 http://localhost:4000/ 不出意外是可以看到页面的
插件
- hexo-admin
- hexo-blog-encrypt
- hexo-deployer-git
- hexo-neat
- hexo-wordcount
- hexo-abbrlink
- Valine
- hexo-git-backup
主题
配置 _config.yml
创建
github
仓库{name}.github.io
修改
_config.yml
里 deploydeploy:
type: git
repository: https://github.com/puzzle9/puzzle9.github.io.git
branch: master
使用 https
的地址每次 push
可能都需要输入用户名密码
姑且推荐用 git
地址
git@github.com:puzzle9/puzzle9.github.io.git
一片新文章/新页面
hexo new post {PostName}
# `source/_posts/{PostName}`
hexo new page {PageName}
# `source/{PageName}`
生成静态文件
hexo g
将本地文件推送至 github
hexo d
hexo 命令
# 启动服务
hexo server -> hexo s
# 生成静态文件
hexo generate -> hexo g
# 将本地文件推送至 github
hexo deploy -> hexo d
# other
clean Remove generated files and cache.
config Get or set configurations.
deploy Deploy your website.
generate Generate static files.
help Get help on a command.
init Create a new Hexo folder.
list List the information of the site
migrate Migrate your site from other system to Hexo.
new Create a new post.
publish Moves a draft post from _drafts to _posts folder.
render Render files with renderer plugins.
server Start the server.
version Display version information.
other
善用搜索 尤其是改样式的时候