使用Hexo框架构建博客并发布
Published in:2023-02-22 |
Words: 403 | Reading time: 1min | reading:

hexo blog desc

  • Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页。

hexo install

  • 安装 Node.js
    在官方网站下载即可安装,链接如下
1
https://nodejs.org/en/
  • 安装 cnpm 或使用淘宝镜像(二选一)
1
2
npm install -g cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
  • 安装 hexo
1
npm install -g hexo-cli

github pages and gitee pages open page services

  • 1.github pages 开通使用

    • 创建与 github 用户同名仓库,命名方式如下
      如图
      img
    1
    username.github.io
    • 开启 github pages 服务
      如图:
      img
  • 2.gitee pages 开通使用

    • 创建与空间名相同仓库

    • 开通 pages 服务(需提前实名认证,较为复杂)

hexo config and themes use

  • 1.在下载结束后,可以编辑 hexo 配置
    • 配置文件_config.yml
1
2
see @link
https://hexo.io/zh-cn/docs/configuration

hexo use

    1. blog 编写
1
hexo new blog
    1. blog md 文件 书写
      采用 MarkerDown 语法

markerdown upload server

    1. 使用以下脚本推送博客更新
1
hexo g -d

使用博客插件在 md 中引入图片资源(网站、vscode 均可用)

  • sh 脚本
1
2
npm install https://github.com/CodeFalling/hexo-asset-image --save
npm install hexo-generator-search --save
  • 渲染库安装
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
npm un hexo-renderer-marked --save
npm install hexo-renderer-markdown-it
or
cnpm install hexo-renderer-markdown-it-plus
cnpm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive
cnpm install --save hexo-renderer-ejs
cnpm install --save hexo-renderer-pug
cnpm install --save hexo-renderer-haml

# Styles
cnpm install --save hexo-renderer-less
cnpm install --save hexo-renderer-sass
cnpm install --save hexo-renderer-stylus
cnpm install --global yo
cnpm install --global generator-hexo-theme
  • 主题库安装
    1
    npm install hexo-theme-next

See also

Prev:
kill_process_app 通过java代码kill进程
Next:
Unity 中绕某个物体旋转方法