Skip to content

0x2CA/0x2CA.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fb89003 · Mar 23, 2020
Mar 20, 2020
Mar 23, 2020
Mar 23, 2020
Mar 18, 2020
Aug 6, 2017
Mar 20, 2020
Mar 20, 2020
Mar 20, 2020
Mar 23, 2020

Repository files navigation

搭建

环境依赖

Hexo项目生成

  1. 安装hexo
$ npm install -g hexo-cli
  1. 生成项目文件
$ hexo init 0x2CA.github.io
  1. 在项目中初始化
npm install

安装主题Maupassant

  1. 安装主题到主题目录
$ git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant
  1. 安装基础渲染器
$ npm install hexo-renderer-pug --save
$ npm install hexo-renderer-sass --save

注:若npm install hexo-renderer-sass安装时报错,可能是国内网络问题,请尝试使用代理或者切换至淘宝NPM镜像安装。

  1. 如果需要站内搜索需要安装
$ npm install hexo-generator-search --save
  1. RSS功能需要安装
$ npm install hexo-generator-feed --save
  1. 分享功能需要安装
$ npm install hexo-helper-qrcode --save
  1. 如果想使用plantuml需要安装
npm install hexo-filter-plantuml --save
  1. 文件统计功能需要安装
npm install hexo-wordcount --save
  1. 图片懒加载需要安装
npm install hexo-lazyload-image --save
  1. 构建压缩需要安装
npm install hexo-neat --save

项目文件说明

  1. package.jsonhexo环境
    • npm install -g
    • npm install --save
  2. _config.ymlhexo配置文件
  3. .gitmodulesgit子模块
  4. .gitignoregit排除配置
  5. themes/maupassant主题文件
  6. source文章源文件
  7. scaffolds文章模板
  8. .deploy_git @ XXXXXgit部署文件

使用

  1. 写文章
    • hexo n '标题'
  2. 渲染
    • hexo g
  3. 发布
    • hexo d
  4. 源文件上传
    • git add --all
    • git commit -m '源文件'
    • git push -u origin hexo