-
Notifications
You must be signed in to change notification settings - Fork 0
/
notiongithub-pages----f5d9bc.html
288 lines (139 loc) · 27.2 KB
/
notiongithub-pages----f5d9bc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Chrome, Firefox OS and Opera Status Bar Color -->
<meta name="theme-color" content="#FFFFFF">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.19.0/themes/prism.min.css">
<link rel="stylesheet" type="text/css" href="css/SourceSansPro.css">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" type="text/css" href="css/notablog.css">
<link rel="stylesheet" type="text/css" href="css/CustomSetting.css">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥥</text></svg>">
<style>
:root {
font-size: 20px;
}
</style>
<title>Notion文章免费&自动发布到GitHub Pages - 知乎 | 413’s Website</title>
<meta property="og:type" content="blog">
<meta property="og:title" content="Notion文章免费&自动发布到GitHub Pages - 知乎">
<meta name="description" content="https://zhuanlan.zhihu.com/p/469320294">
<meta property="og:description" content="https://zhuanlan.zhihu.com/p/469320294">
<style>
.DateTagBar {
margin-top: 1.0rem;
}
</style>
</head>
<body>
<nav class="Navbar">
<a href="index.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥥</text></svg>"></span>
<span>Home</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="blog-collection.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥅</text></svg>"></span>
<span>blog mark</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="Note.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🎶</text></svg>"></span>
<span>Note</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="reference.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>😷</text></svg>"></span>
<span>杂项</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="About.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>😀</text></svg>"></span>
<span>About</span>
</div>
</a>
</nav>
<header class="Header">
<div class="Header__Spacer Header__Spacer--NoCover">
</div>
<h1 class="Header__Title">Notion文章免费&自动发布到GitHub Pages - 知乎</h1>
</header>
<div id="content-html"></div>
<article id="https://www.notion.so/f5d9bc9dd6ba405e80427b2c3ff9ee4f" class="PageRoot"><h2 id="https://www.notion.so/b96e9b27af964abe98de383e48fdac12" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--2"><a class="Anchor" href="#https://www.notion.so/b96e9b27af964abe98de383e48fdac12"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">摘要</span></span></h2><h3 id="https://www.notion.so/77ed650be0854b7c8bce9d136b355d26" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--3"><a class="Anchor" href="#https://www.notion.so/77ed650be0854b7c8bce9d136b355d26"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">本方案需要依赖:</span></span></h3><div id="https://www.notion.so/7191ec848749405eb22fc2aa4c24a810" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">1. </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//www.notion.so/">Notion - One workspace. Every team</a></span></span></p></div><div id="https://www.notion.so/d86d18547094469fb06a60a086d416ab" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">2. </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//github.com/dragonman225/notablog">github.com/dragonman225</a></span></span></p></div><div id="https://www.notion.so/dd0efd06b5584263b5d91a1f735cc7fe" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">3. </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//docs.github.com/cn/actions">docs.github.com/cn/acti</a></span></span></p></div><h3 id="https://www.notion.so/4a8977dba8ec4e6db3d73c2a5fc85a3f" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--3"><a class="Anchor" href="#https://www.notion.so/4a8977dba8ec4e6db3d73c2a5fc85a3f"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">最终可以实现:</span></span></h3><div id="https://www.notion.so/7d195ca61bac42309299c8201ba3ccec" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">1. 有一个自己的</span><span class="SemanticString"><strong class="SemanticString__Fragment SemanticString__Fragment--Bold">免费</strong></span><span class="SemanticString">网页 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Github Pages</code></span></span></p></div><div id="https://www.notion.so/e7217a0baf7248f99597c545469574bd" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">2. 在Notion中写完任何文章后的一天内</span><span class="SemanticString"><strong class="SemanticString__Fragment SemanticString__Fragment--Bold">免费&自动</strong></span><span class="SemanticString">发布到 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Github Pages</code></span><span class="SemanticString"> 中,</span></span></p></div><div id="https://www.notion.so/4b71597a61be4af08eee83108fa46024" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">3. 成品请参考我的网页:</span></span></p></div><div id="https://www.notion.so/10aa616cfd9f48a6808346db91c6149d" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//fizzeryu.github.io/">FizzerYufizzeryu.github.io/</a></span></span></p></div><h2 id="https://www.notion.so/86e5302cf44c4cbcaadac5545bc8d56c" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--2"><a class="Anchor" href="#https://www.notion.so/86e5302cf44c4cbcaadac5545bc8d56c"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">步骤</span></span></h2><div id="https://www.notion.so/29e48b0df09e404cae0f48c2cefa340f" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">1. 首先你要有个Github账号和Notion账号,如果你是学生的话可以免费领取 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//education.github.com/pack">GitHub Student Developer Pack</a></span><span class="SemanticString"> 和 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//www.notion.so/product/notion-for-education">Notion for Education</a></span></span></p></div><div id="https://www.notion.so/cd239de6ae114ca399d1b0694bc7076e" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">2. 创建一个新仓库,需要给这个仓库一个比较特殊的名字,比如说 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=http%3A//username.github.io/">userName.github.io</a></span><span class="SemanticString">,注意这里的 userName 可以是任意你喜欢的名字,但是</span><span class="SemanticString"><strong class="SemanticString__Fragment SemanticString__Fragment--Bold">强烈推荐使用自己的github用户名</strong></span></span></p></div><div id="https://www.notion.so/58837c19db1d47e49f10022c95ee30c3" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">3. 把这个 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//www.notion.so/b6fcf809ca5047b89f423948dce013a0">Notion表格模板</a></span><span class="SemanticString"> 复制到自己的Notion账号中【右上角的 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Duplicate</code></span><span class="SemanticString"> 按钮】,把这个表格设置为公开【 点击右上角的 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Share</code></span><span class="SemanticString"> 按钮→ </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Share to web</code></span><span class="SemanticString"> 打开 】,然后点击 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Copy</code></span><span class="SemanticString"> 按钮复制网址</span></span></p></div><div id="https://www.notion.so/dd727a4193ba48fab085a9388e520f47" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">3.1 比如说我复制出来的网址是 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">https://www.notion.so/2c4dc4affe68463da4f61f8fa93406e0</code></span><span class="SemanticString">,打开这个网址检查一下是不是对应的表格模板</span></span></p></div><div id="https://www.notion.so/d494b9212a6d43eab8ae63dc21de1385" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">4. fork仓库 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=https%3A//github.com/dragonman225/notablog-starter">github.com/dragonman225</a></span><span class="SemanticString"> ,修改 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">config.json</code></span><span class="SemanticString"> 文件中的 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">url</code></span></span></p></div><div id="https://www.notion.so/cc9d1423178e4a4ab85b41d3a775a02f" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">1. 原始的url为:</span></span></p></div><pre id="https://www.notion.so/3fd5f76d63b245f5ab49ae4ea581b8a8" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>https://s413.notion.site/557024fb04f24f2ea19e487557abbaae?v=b2d8ec9e232144e596f40037707d674e<span class="token punctuation">&</span>pvs=4</span></span></span></code></pre><pre id="https://www.notion.so/9df2732c77c2420c9d490b7540393843" class="Code"><code><span class="SemanticStringArray"><span class="SemanticString"><span>"url": "https://www.notion.so/b6fcf809ca5047b89f423948dce013a0?v=03ddc4d6130a47f8b68e74c9d0061de2",</span></span></span></code></pre><div id="https://www.notion.so/f84a1a9dfad14312b530134074f66482" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">2. 将 b6fc...de2 这段字符修改为 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">步骤3.1</code></span><span class="SemanticString"> 中的网址后缀(也就是 2c4dc...b594)</span></span></p></div><div id="https://www.notion.so/d0dd2365e137490ba91cb5d72e01955b" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">3. 对应到本文中也就是修改为:</span></span></p></div><pre id="https://www.notion.so/8eceda1b93154013bc6620e3b9fd19c0" class="Code"><code><span class="SemanticStringArray"><span class="SemanticString"><span>"url": "https://www.notion.so/2c4dc4affe68463da4f61f8fa93406e0?v=9ad1da13a555443598a33b3bfc3db594"</span></span></span></code></pre><div id="https://www.notion.so/ded4bb549c4f4caca3ec0df13cd61667" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">5. 创建 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Personal access token</code></span></span></p></div><div id="https://www.notion.so/20d0de45b34f4fc38ba0788bbac91b20" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">5.1. 打开 </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=http%3A//github.com/">Github.com</a></span><span class="SemanticString">,依次点击 右上角头像 → Settings → Developer settings → Personal Access Tokens → 右上角Generate new token → 按照示例修改下面</span></span></p></div><div id="https://www.notion.so/c05030978cb445af93c4dbba63f8ed22" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">5.2. 最后点击最下方的 Generate token ,就会生成一个字符串,复制这个字符串备用【</span><span class="SemanticString"><span class="SemanticString__Fragment SemanticString__Fragment--Unknown"><strong class="SemanticString__Fragment SemanticString__Fragment--Bold">注意千万别泄露这个字符串,有安全风险</strong></span></span><span class="SemanticString">】</span></span></p></div><div id="https://www.notion.so/a90e3d99d1164127b25e4e423934e2de" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">6. 回到你在 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">步骤4</code></span><span class="SemanticString"> 中fork的名为 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">notablog-starter</code></span><span class="SemanticString"> 仓库,依次点击 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">settings</code></span><span class="SemanticString"> → </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">secrets</code></span><span class="SemanticString"> → </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">actions</code></span><span class="SemanticString"> → </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">New repository secret</code></span><span class="SemanticString">, Name 填为 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">ACCESS_TOKEN</code></span><span class="SemanticString"> ,Value 就是上一步( </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">步骤5.2</code></span><span class="SemanticString"> )生成的字符串,具体如图所示:</span></span></p></div><div id="https://www.notion.so/53e6d11db2754c468010663b511bbd66" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">7. 回到你在 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">步骤4</code></span><span class="SemanticString"> 中fork的名为 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">notablog-starter</code></span><span class="SemanticString"> 仓库,依次点击 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">Actions</code></span><span class="SemanticString"> → </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">New workflow</code></span><span class="SemanticString"> → </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">set up a workflow yourself</code></span></span></p></div><div id="https://www.notion.so/7896e0e1a91a4350a8d0380a5fa4e362" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">7.1. 使用下方代码覆盖原始文件,注意代码需要修改两处位置:</span></span></p></div><pre id="https://www.notion.so/15a47d5bacb243eba26d300081a0ef57" class="Code"><code><span class="SemanticStringArray"><span class="SemanticString"><span> # This is a basic workflow to help you get started with Actions
name: Github Pages
# Controls when the workflow will run
on:
schedule:
# 下一行是说在每天的国际标准时间23点(北京时间早上7点)触发该任务
# 你可以随意修改
- cron: '0 23 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# 拉取代码
- name: Checkout
uses: actions/checkout@v2
# 1、生成静态文件
- name: Build
run: npm i -g notablog && notablog generate .
# 2、部署到 GitHub Pages
- name: Deploy
uses: JamesIves/[email protected]
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository-name: FizzerYu/FizzerYu.github.io # 修改这里
BRANCH: main # 如果你的仓库默认分支是 master 记得修改这里
FOLDER: public</span></span></span></code></pre><div id="https://www.notion.so/053aac1a2a644b398585618a2d9c6ef2" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">7.2. 上方代码需要修改 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">repository-name</code></span><span class="SemanticString"> ,具体就是步骤2中创建的仓库的 `git clone` 地址,比如说:</span></span></p></div><pre id="https://www.notion.so/6b89a94e356b4293930f10e564a8c771" class="Code"><code><span class="SemanticStringArray"><span class="SemanticString"><span># git clone 地址为:
[email protected]:FizzerYu/FizzerYu.github.io.git
# 因此 repository-name 为:
FizzerYu/FizzerYu.github.io</span></span></span></code></pre><div id="https://www.notion.so/45d61a26fba24258b3dd15e1cfd9365c" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">7.3. 注意 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">步骤2</code></span><span class="SemanticString"> 中创建的仓库默认分支名是否与 </span><span class="SemanticString"><code class="SemanticString__Fragment SemanticString__Fragment--Code">BRANCH</code></span><span class="SemanticString"> 参数一致</span></span></p></div><div id="https://www.notion.so/dae48f04f96847aeb41c0f8d2795fee4" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">7.4. 按照要求修改完成后保存:</span></span></p></div><div id="https://www.notion.so/4511af95ba8840c3a530ae0b783838af" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">8. 按照下图要求依次点击:</span></span></p></div><div id="https://www.notion.so/0dd96b9459d640b4b568c03a5ba8a5c1" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">9. 稍等片刻(大概10min内),就可以打开你的github pages查看啦!比如说我的网址 `</span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://link.zhihu.com/?target=http%3A//FizzerYu.github.io">FizzerYu.github.io</a></span><span class="SemanticString">`</span></span></p></div><h2 id="https://www.notion.so/338b6074813d480f912f1c0f1b55ae6c" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--2"><a class="Anchor" href="#https://www.notion.so/338b6074813d480f912f1c0f1b55ae6c"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">测试</span></span></h2><div id="https://www.notion.so/72134d29b97f44b49f0a540b30ce78ec" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">1. 在notion中找到复制出来的模板,复制一行数据</span></span></p></div><div id="https://www.notion.so/afff7c5146eb4711bbdcccb45246405d" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">2. 然后随便写点东西,再重复步骤8、9,或者等待一天,就可以看到新的文章啦!</span></span></p></div></article>
<aside class="Aside">
<a href="#content-html"><div id="up">👆</div></a>
<a href="#message-board"><div id="down">👇</div></a>
</aside>
<div id="message-board"></div>
<script src="https://utteranc.es/client.js"
repo="syx-413/syx-413.github.io"
issue-term="pathname"
theme="boxy-light"
crossorigin="anonymous"
async>
</script>
<footer class="Footer">
<div>
© 413’s Website 2020~2024
</div>
<div>
·
</div>
<div>
Powered by
<a href="https://github.com/syx-413" target="_blank" rel="noopener noreferrer"> notablog</a>.
</div>
</footer>
</body>
</html>