1 第一步:基礎安裝
安裝git和nodejs
2 第二步:申請github賬號
申請github賬戶并建立xxx.github.io項目
3 第三步:安裝hexo
安裝之前先改鏡像地址,國內(nèi)環(huán)境,你懂的
npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝hexo
cnpm install -g hexo-cli
cnpm install hexo --save
校驗是否完成
hexo -v
初始化
hexo init
安裝依賴
cnpm install
預覽
hexo s -g
4 第四步: 管理
配置修改
#博客名稱
title: 我的博客
#副標題
subtitle: 一天進步一點
#簡介
description: 記錄生活點滴
#博客作者
author: John Doe
#博客語言
language: zh-CN
#時區(qū)
timezone:
#博客地址,與申請的GitHub一致
url: http://elfwalk.github.io
root: /
#博客鏈接格式
permalink: :year/:month/:day/:title/
permalink_defaults:
...
#日期格式
date_format: YYYY-MM-DD
time_format: HH:mm:ss
#分頁毅待,每頁文章數(shù)量
per_page: 10
pagination_dir: page
#博客主題
theme: landscape
#發(fā)布設置
deploy:
type: git
#elfwalk改為你的github用戶名
repository: https://github.com/elfwalk/elfwalk.github.io.git
branch: master
創(chuàng)建文章
hexo new "hello"
5 發(fā)布
安裝hexo的git工具
cnpm install hexo-deployer-git --save
發(fā)布
hexo d -g