Skip to content
tan90° edited this page Jul 12, 2018 · 11 revisions

安装

通过 Node.js 安装,没有安装 Node.js ? 看这里

# 注意是首字母大写的 Mirror
$ sudo npm install Mirror -g

使用

新建一个博客

$ cd blog
$ mirror init

或者

$ mirror init blog

配置你的博客

首先获取你的 token, 然后修改 config.yml

# 是否为组织项目
organization: false

# 文章排序,依据更新时间还是创建时间
# 值为 'UPDATED_AT' 或者 'CREATED_AT'
order: 'UPDATED_AT'

# 网站标题
title:

# GitHub 用户名或者组织名
user:

# 项目名称,项目里面的 issues 是你的博客内容
# 如果你的项目是组织项目,请设置 'organization' 为 true
repository:

# 多用户设置,上面设置的 user 用户名默认已经包括
# 多用户名字必须用 ',' 分割
# 例子: author0,author1
authors:

# token 设置
# token 必须以 '#' 分割
# 如果你的 token 是 5c31bffc137f44faf7efc4a84da827g7ca2cfeaa 
# 那么这里填入的值为 5#c31bffc137f44faf7efc4a84da827g7ca2cfeaa
token:

# 文章列表分页
perpage: 10

这里有一个例子 config

生成你的博客

$ mirror build

发布你的博客

将所有内容都 push 到一个项目的 gh-pages 分支,你也可以在 CNAME 上定义你的域名

例子

博客: https://mirror.am0200.com/

博客项目: https://github.com/LoeiFy/Mirror/tree/gh-pages

博客内容: https://github.com/LoeiFy/Recordum/issues

Clone this wiki locally