简介
Hexo 是一个快速、简单且功能强大的博客框架。你用 Markdown(或其他标记语言)写帖子,Hexo 会在几秒钟内生成带有漂亮主题的静态文件。
个人理解:
hexo
是一个解释器,将 标记语言(markdown
等.) 转化成 html
代码,并赋能 分类,标签,评论,搜索 等 博客功能 进行集中管理,是一个非常轻便管理工具.
官网:
https://hexo.io/
注意:
本文使用的版本:
hexo: 5.4.0
hexo-cli: 4.2.0
node: 14.16.1
安装
# 手脚架
npm i -g hexo-cli
# 初始化项目
hexo init hexo-frist-project
# 运行服务
hexo s -o
INFO Validating config
INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
# 恭喜你拥抱了 Hexo
常用命令
# 启动博客服务
hexo s
# 生成静态页面
hexo g
命令大全
hexo --help
INFO Validating config
Usage: hexo <command>
Commands:
# 清除缓存
clean Remove generated files and cache.
# 获取当前 config 内容
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
# 从其他站点迁移到 Hexo
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.
Global Options:
--config Specify config file instead of using _config.yml
--cwd Specify the CWD
--debug Display all verbose messages in the terminal
--draft Display draft posts
--safe Disable all plugins and scripts
--silent Hide output on console