工具

个人博客-GitHub-Pages

2019-08-18  本文已影响0人  闲云a

小序

  1. 创建GitHub Pages
  2. 安装Git
  3. 安装Node.js
  4. 安装hexo

GitHub Pages

  1. 注册GitHub账号,新建仓库,仓库名格式为(用户名.github.io),用户名必须与GitHub保持一致。
  2. 仓库中点击Settings菜单,找到GitHub Pages
  3. Choose a theme

Hexo

Hexo是一个快速、简洁且高效的博客框架。使用Markdown解析文章,在几秒内,即可利用靓丽的主题生成静态网页。
Windows搭建Hexo博客系统并部署到GitHub

  1. 安装hexo本地环境,使用命令:npm install -g hexo
  2. 计算机本地新建保存博客文件夹
  3. 初始化hexo博客工程:hexo init
  4. 执行编译与预览命令后,hexo预览http://localhost:4000/

命令

命令
[hexo n “博客名称”] 新建博客

themes

主题设置

  1. 博客根目录:git clone https://github.com/theme-next/hexo-theme-next themes/next
  2. 修改站点配置文件_config.yml中theme为目标主题名称

theme-NexT

主题配置文件_config.yml

plugins

hexo部署插件

  1. npm install hexo-deployer-git --save
  2. 修改站点配置文件_config.yml,在deploy下指定仓库路径和部署的协议


    _config.yml
  3. hexo g
  4. hexo d

hexo-admin

npm install hexo-admin --save
Hexo Admin

hexo-toc

npm install hexo-toc --save
文章中添加目录,在站点配置文件_config.yml中,添加如下信息:

# 文章顶部添加<!-- toc -->,会在标题下方生成文章目录。
toc:
  maxdepth: 3
  class: toc
  slugify: transliteration
  decodeEntities: false
  anchor:
    position: after
    symbol: ''
    style: header-anchor

<font color="#ff0000">注意坑:</font>主题为NexT时,不要安装该插件,会导致sidebar中文章目录显示错误且不跳转。

jekyll

jekyll

jekyll themes

上一篇 下一篇

猜你喜欢

热点阅读