Hexo+github博客搭建

Hexo博客框架+gitee网站发布

  • 安装依赖环境nodejs,git。

  • 安装hexo, hexo 主页 https://hexo.io/zh-cn/

    •   npm config set registry http://registry.npm.taobao.org
        
      1
      2
      - ```
      npm install hexo -cli -g
  • 生成博客文件:在文件夹下输入cmd,运行 hexo init

  • 预览

    1
    hexo s
  • 部署到gitee平台。

    • 修改_config.xml文件。

      1
      2
      3
      4
      5
      6
      7
      8
      deploy:
      # type: git
      # repo: https://github.com/ansonsee/stilnc
      # branch: main

      type: git
      repo: https://gitee.com/stilnc/stilnc.git
      branch: master
      • 安装一键部署工具
        1
        npm install hexo-deployer-git --save
  • 生成静态文件

    1
    hexo g
  • 部署

    1
    hexo d 或者 hexo c && hexo d

    部署后要在gitee服务页面上更新。

  • 使用主题Ayer,说明文档地址 https://ayer.886622.xyz/2019/ayer/

  • 需要说明的是插入图片的路径为 [/文件夹/图片名,名字] 方式。

  • 创建新的文章

    1
    hexo new 文件名

Hexo 部署博客步骤

  1. 写文章三种方式

    1. 使用hexo new <title>
      2. 使用编辑器写,保存Makedown文件到Hexo项目下source文件夹。
      3. 语雀网页剪藏,导出Makedown文件。
  2. 文章属性配置 Front-matter

    1. 三组破折号中间写,title 必须写了才显示。
1
2
3
4
5
---
title: Hello World
date: 2013/7/13 20:46:25
tags: 技术,输出
---
  1. 标签插件与资源

    ​ 用于文章中嵌入各种资源。

    1. 视频插入两种方式

      1. B站视频分享——嵌入代码。来使用框架