安装Hexo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19sudo npm install -g hexo-cli
hexo -v
hexo: 3.9.0
hexo-cli: 1.0.2
os: Linux 4.4.0-154-generic linux x64
http_parser: 2.8.0
node: 10.15.3
v8: 6.8.275.32-node.51
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0j
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e创建博客项目
1
2
3
4
5
6
7
8hexo init yt8yt.github.io
cd yt8yt.github.io
npm install
3. 测试刚刚创建的项目
```shell
hexo server使用浏览器访问本机
4000
端口。更新博客配置信息
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15vi _config.yml
Site
title: yt8yt's note
subtitle:
description: yt8yt's personal blog
author: yt8yt
language:
timezone: Japan
URL
# If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://yt8yt.github.io/
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:安装发布包
1
2
3
4
5
6
7
8sudo npm install hexo-deployer-git --save
vi _config.yml
Deployment
# Docs: http://hexo.io/docs/deployment.html
deploy:
type: git
repo: git@github.com:yt8yt/yt8yt.github.io.git
branch: master配置
watch
监控文件改动1
hexo generate --watch
创建新博客文章
1
hexo new first-post
使用
markdown
语言编辑博客文章删除
source/_posts/hello-world.md
发布!
1
2hexo clean
hexo deploy你应该会在
GitHub Pages
看到你的博客了,地址为http://****.github.io
。改变主题
例如,安装https://hexo.io/hexo-theme-light/
主题。1
2
3
4
5
6
7
8# 安装
cd yt8yt.github.io
git clone git://github.com/tommy351/hexo-theme-light.git themes/light
# 改变配置文件
cd yt8yt.github.io
vi _config.yml
theme: light- 创建新页面
1
2
3hexo new page aboutme
cd source/aboutme
vi index.md