Skip to content

Commit f4223c5

Browse files
committed
gitbook
1 parent a58eee0 commit f4223c5

File tree

3 files changed

+175
-0
lines changed

3 files changed

+175
-0
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build my gitbook and deploy to gh-pages
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
master-to-gh-pages:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: checkout master
15+
uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
ref: master
19+
20+
- name: install nodejs
21+
uses: actions/setup-node@v1
22+
23+
- name: configue gitbook
24+
run: |
25+
npm install -g gitbook-cli
26+
gitbook install
27+
npm install -g gitbook-summary
28+
29+
- name: generate _book folder
30+
run: |
31+
book sm
32+
ln -s -f SUMMARY.md Content.md
33+
gitbook build
34+
cp SUMMARY.md _book
35+
36+
- name: push _book to branch gh-pages
37+
env:
38+
TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
39+
REF: github.com/${{github.repository}}
40+
MYEMAIL: kimi0230@gmail.com
41+
MYNAME: ${{github.repository_owner}}
42+
run: |
43+
cd _book
44+
git config --global user.email "${MYEMAIL}"
45+
git config --global user.name "${MYNAME}"
46+
git init
47+
git remote add origin https://${REF}
48+
git add .
49+
git commit -m "Updated By Github Actions With Build ${{github.run_number}} of ${{github.workflow}} For Github Pages"
50+
git branch -M master
51+
git push --force --quiet "https://${TOKEN}@${REF}" main:gh-pages

book.json

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"title": "Kimi's Golang Notes",
3+
"description": "My gitbook for Golang, Leetcode, Interview",
4+
"author": "Kimi Tsai <kimi0230@gmail.com>",
5+
"ignores": [
6+
"node_modules"
7+
],
8+
"links": {
9+
"sidebar": {
10+
"Home": "https://kimi0230.github.io/MyGoNote/",
11+
"GitHub": "https://github.com/kimi0230/MyGoNote",
12+
"Medium": "https://medium.com/@kimi0230",
13+
"About me": "https://github.com/kimi0230"
14+
}
15+
},
16+
"plugins": [
17+
"-search",
18+
"-lunr",
19+
"search-plus",
20+
"-sharing",
21+
"sharing-plus",
22+
"expandable-chapters",
23+
"splitter",
24+
"-anchor-navigation-ex",
25+
"-toggle-chapters",
26+
"back-to-top-button",
27+
"page-footer-ex",
28+
"favicon-absolute",
29+
"github",
30+
"github-buttons",
31+
"-disqus",
32+
"-codeblock-filename",
33+
"code",
34+
"-copy-code-button",
35+
"-emphasize",
36+
"page-toc",
37+
"intopic-toc",
38+
"-tbfed-pagefooter",
39+
"edit-link",
40+
"auto-scroll-table",
41+
"wide-page",
42+
"tags"
43+
],
44+
"pluginsConfig": {
45+
"favicon-absolute": {
46+
"favicon": "/favicon.ico",
47+
"bookmark": "/bookmark.ico",
48+
"appleTouchIcon152": "/apple-touch-icon-152.png",
49+
"appleTouchIconPrecomposed152": "/apple-touch-icon-precomposed-152.png",
50+
"appleTouchIconMore": {
51+
"120x120": "/apple-touch-icon-120.png",
52+
"180x180": "/apple-touch-icon-180.png"
53+
},
54+
"appleTouchIconPrecomposedMore": {
55+
"120x120": "/apple-touch-icon-precomposed-120.png",
56+
"180x180": "/apple-touch-icon-precomposed-180.png"
57+
}
58+
},
59+
"expandable-chapters": {
60+
"mode": "pageTop",
61+
"showGoTop": true
62+
},
63+
"github": {
64+
"url": "https://github.com/kimi0230"
65+
},
66+
"github-buttons": {
67+
"buttons": [
68+
{
69+
"user": "kimi0230",
70+
"repo": "MyGoNote",
71+
"type": "star",
72+
"size": "small"
73+
}
74+
]
75+
},
76+
"sharing": {
77+
"facebook": true,
78+
"twitter": true,
79+
"google": false,
80+
"weibo": false,
81+
"instapaper": false,
82+
"vk": false,
83+
"line": true,
84+
"all": [
85+
"facebook",
86+
"google",
87+
"twitter",
88+
"weibo",
89+
"instapaper",
90+
"line"
91+
]
92+
},
93+
"intopic-toc": {
94+
"label": "CONTENTS"
95+
},
96+
"disqus": {
97+
"shortName": "Kimi's Gitbook"
98+
},
99+
"page-footer-ex": {
100+
"copyright": "&copy Kimi Tsai all right reserved.",
101+
"markdown": false,
102+
"update_label": "<i>Updated</i> : ",
103+
"update_format": "YYYY-MM-DD HH:mm:ss"
104+
},
105+
"edit-link": {
106+
"base": "https://github.com/kimi0230/MyGoNote/edit/main/",
107+
"label": "Edit"
108+
}
109+
},
110+
"pdf": {
111+
"pageNumbers": true,
112+
"fontSize": 12,
113+
"paperSize": "a4",
114+
"margin": {
115+
"right": 62,
116+
"left": 62,
117+
"top": 36,
118+
"bottom": 36
119+
},
120+
"headerTemplate": null,
121+
"footerTemplate": null
122+
}
123+
}

tags.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Tags

0 commit comments

Comments
 (0)