-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Gitbook build config and Travis CI support
- Loading branch information
1 parent
3cada88
commit 27e639a
Showing
2 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "8" | ||
|
||
# 缓存依赖 | ||
cache: | ||
directories: | ||
- $HOME/.npm | ||
|
||
before_install: | ||
- export TZ='Asia/Shanghai' # 更改时区 | ||
|
||
# 依赖安装 | ||
install: | ||
- npm install -g gitbook-cli gitbook-summary | ||
|
||
# 构建脚本 | ||
script: | ||
# 自定义输出目录 gitbook build src dest | ||
- cd ./blog | ||
- gitbook install | ||
- book sm | ||
- cat SUMMARY.md | ||
- gitbook build . ../blog-build | ||
|
||
# 分支白名单 | ||
branches: | ||
only: | ||
- master # 只对 master 分支进行构建 | ||
|
||
# GitHub Pages 部署 | ||
deploy: | ||
provider: pages | ||
skip_cleanup: true | ||
# 在项目仪表盘的 Settings -> Environment Variables 中配置 | ||
github_token: $GITHUB_TOKEN | ||
# 将 build 目录下的内容推送到默认的 gh-pages 分支上,并不会连带 build 目录一起 | ||
local_dir: blog-build | ||
name: $GIT_NAME | ||
email: $GIT_EMAIL | ||
on: | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"title": "Learn React Source Code", | ||
"author": "cyan33", | ||
"links": { | ||
"sidebar": { | ||
"Learn React Source Code": "https://github.com/cyan33/learn-react-source-code" | ||
} | ||
}, | ||
"plugins": [ | ||
"-lunr", | ||
"-search", | ||
"search-plus", | ||
"splitter", | ||
"anchors", | ||
"anchor-navigation-ex", | ||
"copy-code-button", | ||
"expandable-chapters", | ||
"theme-darkblue", | ||
"theme-comscore", | ||
"tbfed-pagefooter", | ||
"prism", | ||
"-highlight", | ||
"github-buttons", | ||
"edit-link", | ||
"disqus" | ||
], | ||
"pluginsConfig": { | ||
"tbfed-pagefooter": { | ||
"modify_label": "最近更新:", | ||
"modify_format": "YYYY-MM-DD HH:mm" | ||
}, | ||
"prism": { | ||
"css": [ | ||
"prismjs/themes/prism-tomorrow.css" | ||
] | ||
}, | ||
"github-buttons": { | ||
"buttons": [{ | ||
"user": "cyan33", | ||
"repo": "learn-react-source-code", | ||
"type": "star", | ||
"size": "small", | ||
"count": true | ||
}] | ||
}, | ||
"edit-link": { | ||
"base": "https://github.com/cyan33/learn-react-source-code/edit/master/blog", | ||
"label": "Edit This Page" | ||
}, | ||
"sharing": { | ||
"facebook": false, | ||
"twitter": true, | ||
"weibo": true | ||
}, | ||
"disqus": { | ||
"shortName": "gitbook-8" | ||
}, | ||
"anchor-navigation-ex": { | ||
"multipleH1": false | ||
} | ||
}, | ||
"ignores": [ | ||
".*", | ||
"build", | ||
"_book", | ||
"gitbook", | ||
"node_modules" | ||
] | ||
} |