-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsearch.xml
98 lines (45 loc) · 56 KB
/
search.xml
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
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>推荐几个免费图床</title>
<link href="/2023/07/13/%E6%8E%A8%E8%8D%90%E5%87%A0%E4%B8%AA%E5%85%8D%E8%B4%B9%E5%9B%BE%E5%BA%8A/"/>
<url>/2023/07/13/%E6%8E%A8%E8%8D%90%E5%87%A0%E4%B8%AA%E5%85%8D%E8%B4%B9%E5%9B%BE%E5%BA%8A/</url>
<content type="html"><![CDATA[<p>最近频繁使用到图床,搜集了自己使用过的比较好用的图床网站,有知名大站也有小众网站,使用体验都不错</p><p>排名不分先后</p><h2 id="有备案域名"><a href="#有备案域名" class="headerlink" title="有备案域名"></a>有备案域名</h2><p>有备案域名的先看这里,没有的往下拉</p><h3 id="七牛"><a href="#七牛" class="headerlink" title="七牛"></a>七牛</h3><p>地址:<a href="https://www.qiniu.com/prices/kodo">https://www.qiniu.com/prices/kodo</a></p><p>开通七牛云对象存储服务的实名认证用户,每月可享受一定量的标准存储免费存储空间、标准存储免费 CDN 回源流量和标准存储免费请求数目。</p><p>每月计费时,会先抵扣免费额度,超出部分再按照价格详情付费结算。</p><table><thead><tr><th>标准存储每月免费空间</th><th>标准存储每月免费 CDN 回源流量</th><th>标准存储每月免费写请求 PUT/DELETE</th><th>标准存储每月免费读请求 GET</th><th>每月免费上传流量</th></tr></thead><tbody><tr><td>10GB</td><td>10GB</td><td>10万次</td><td>100万次</td><td>无上限</td></tr></tbody></table><h3 id="青云QingCloud"><a href="#青云QingCloud" class="headerlink" title="青云QingCloud"></a>青云QingCloud</h3><p>地址:<a href="https://www.qingcloud.com/products/objectstorage/">https://www.qingcloud.com/products/objectstorage/</a></p><p>注册成功并完成认证的 QingStor 对象存储用户,青云QingCloud 为您提供一定额度的 QingStor 对象存储免费使用套餐。每个 Bucket 享有如下免费政策:</p><ul><li>标准存储空间:20 GB</li><li>总外网下载流量:10 GB</li><li>总外网读请求 (GET/HEAD):100 万次</li><li>总外网写请求 (PUT/POST/DELETE):10 万次</li></ul><h3 id="多吉云"><a href="#多吉云" class="headerlink" title="多吉云"></a>多吉云</h3><p>地址:<a href="https://www.dogecloud.com/price?product=oss">https://www.dogecloud.com/price?product=oss</a></p><p><strong>如果视频空间占用量小于 20 GB,则空间占用免费。如果当日的流量消耗大于当日的空间占用量,则空间占用免费</strong></p><p>举例来说,如果你视频云空间占用 40 GB,当日流量消耗 30 GB,那么你当日就有 30 GB 的存储免费额度,只需要对剩下 10 GB 进行计费。如果你空间占用在 20 GB 以下,不管你流量消耗多少,空间占用都是免费的。</p><table><thead><tr><th>视频云空间</th><th>空间网络基础</th><th>融合CDN</th><th>云存储</th></tr></thead><tbody><tr><td>0~ 20 GB</td><td>20 GB</td><td>20 GB</td><td>0~ 10 GB</td></tr></tbody></table><p>表格都是每个月免费的额度</p><h3 id="又拍云"><a href="#又拍云" class="headerlink" title="又拍云"></a>又拍云</h3><p>加入联盟地址:<a href="https://www.upyun.com/league">https://www.upyun.com/league</a></p><p>加入又拍云联盟的站长,需要将网站底部加上又拍云的LOGO,申请加入联盟,可以得到免费10GB存储空间和15GB每月流量,申请通过后又拍云会把上述资源折算成等额的代金券发放至账户中,并且一次性发放一年的代金券,面值67元。唯一不足的就是需要我们加上LOGO,如果被发现取消则会被取消资格,第二年依旧是免费续签。</p><h2 id="无备案域名"><a href="#无备案域名" class="headerlink" title="无备案域名"></a>无备案域名</h2><p>没有备案域名就看这栏吧</p><h3 id="sm-ms图床"><a href="#sm-ms图床" class="headerlink" title="sm.ms图床"></a>sm.ms图床</h3><p>中大陆只能访问这个地址了<a href="https://smms.app/">https://smms.app/</a></p><ul><li>优点:<ol><li>免费(5G的存储空间);不用考虑流量问题。</li><li>网页端有预览功能。</li><li>上传后不可修改(不可重命名)。 对于外链url这算优点,保证了以往引用的的外链url不会失效。(<strong>它用的不是直链,实测重命名不会影响之前外链的url</strong>)</li></ol></li><li>缺点:<ol><li>使用PicGo上传有时会出现上传失败的情况,可能是网络原因?(后来使用体验好了很多。)。</li><li>可能会跑路?不过它在免费图床里算是最可靠的了。它跑路的概率肯定比下面的路过图床的概率低。</li><li>网有点慢。</li><li>有预览功能,但只是一列排开,(相较于下面的路过图床来说)没有相册那种形式方便。但也不错了。</li><li>上传时不可以重命名、不可以剪裁。(严格来说,这不算是缺点)。</li></ol></li></ul><h3 id="路过图床"><a href="#路过图床" class="headerlink" title="路过图床"></a>路过图床</h3><p>地址:<a href="https://imgse.com/">https://imgse.com/</a></p><p>介绍:比较知名的图床,用户使用较多的图床工具之一,个人认为是仅次于sm.ms的选择,毕竟已经自2011年运营至了。跑路的可能性不大。 但是不建议作为主力,虽然跑路的可能性不大,但还是有的。免费,但是页面有少量广告。高速稳定的图片上传和外链服务,全球CDN加速,最大单张支持 10 MB,支持批量上传。不过在上传之后,展现的预览和编辑,需要二次确认之后才能上传进行使用,有点繁琐。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="聚合图床"><a href="#聚合图床" class="headerlink" title="聚合图床"></a>聚合图床</h3><p>地址:<a href="https://www.superbed.cn/">https://www.superbed.cn/</a></p><p>介绍:聚合图床依托于七牛腾讯阿里云等,用户可以自己选择上传策略,上传图片:可选jpg/png/bmp/webp等所有支持的图片格式,可批量上传。没有流量限制、速度也可以,关键是不需要各种设置,很适合不爱折腾的朋友使用,上手难度很低,是目前图床的新势力。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-1.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-1.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-1.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="imgurl图床"><a href="#imgurl图床" class="headerlink" title="imgurl图床"></a>imgurl图床</h3><p>地址:<a href="https://www.imgurl.org/">https://www.imgurl.org/</a></p><ul><li>优点:<ol><li>免费。不用考虑存储费用和流量费用。</li></ol></li><li>缺点:<ol><li>难保不会跑路(可能性不大)。</li><li>上传数量受限制。每日20涨,每月400张。</li></ol></li></ul><h3 id="老王图床"><a href="#老王图床" class="headerlink" title="老王图床"></a>老王图床</h3><p>地址:<a href="https://img.gejiba.com/">https://img.gejiba.com/</a></p><p>介绍:无需注册,可以上传 JPG PNG BMP GIF WEBP 等格式,支是国内服务器和 CDN,图片加载速度教快。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-3.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-3.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-3.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="小鸭图床"><a href="#小鸭图床" class="headerlink" title="小鸭图床"></a>小鸭图床</h3><p>地址:<a href="http://image.kypeople.cn/">http://image.kypeople.cn/</a></p><p>介绍:依托于腾讯云储存与CDN加速,国内访问速度还可以,单个最大上传4M。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-5.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-5.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-5.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="TG图床"><a href="#TG图床" class="headerlink" title="TG图床"></a>TG图床</h3><p>地址:<a href="https://imgtg.com/">https://imgtg.com/</a></p><p>介绍:多年老图床,有国内百度云cdn节点加速,在上传测试中,GIF上传速度约 2 秒。图片上传限制:每个图片最大5M。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-6.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-6.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-6.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="moeto图床"><a href="#moeto图床" class="headerlink" title="moeto图床"></a>moeto图床</h3><p>地址:<a href="https://moetu.org/">https://moetu.org/</a></p><p>介绍:免费,图片上传限制:每个图片最大20M。moetu图床除了连接稳定上传外,还支持图片分类、搜索等功能。亲测网站打开有一些缓慢,。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-7.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-7.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-7.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="七喜图床"><a href="#七喜图床" class="headerlink" title="七喜图床"></a>七喜图床</h3><p>地址:<a href="https://7up.pics/">https://7up.pics/</a></p><p>介绍:一个小众图床,使用体验还可以,速度较快,单个最大上传5M。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-8.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-8.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-8.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="Z4A图床"><a href="#Z4A图床" class="headerlink" title="Z4A图床"></a>Z4A图床</h3><p>地址:<a href="https://www.z4a.net/">https://www.z4a.net/</a></p><p>介绍:需要注册才能使用,速度较快,支持 JPG PNG BMP GIF WEBP 等格式,照片最大可上传64M。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-9.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-9.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-9.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="图仓"><a href="#图仓" class="headerlink" title="图仓"></a>图仓</h3><p>地址:<a href="https://www.imagehub.cc/">https://www.imagehub.cc/</a></p><p>介绍:免费图片托管,专业图片外链,免费图床,公益图床,免费相册,支持相册加密,支持图片批量上传,原图保存,不限空间,不限流量。</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/05/image-10.png" title="推荐几个免费图床"><img src="https://blog.aerr.cn/wp-content/uploads/2023/05/image-10.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/05/image-10.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p>]]></content>
</entry>
<entry>
<title>一个hexo博客后台–Qexo</title>
<link href="/2023/07/11/%E4%B8%80%E4%B8%AAhexo%E5%8D%9A%E5%AE%A2%E5%90%8E%E5%8F%B0%E2%80%93Qexo/"/>
<url>/2023/07/11/%E4%B8%80%E4%B8%AAhexo%E5%8D%9A%E5%AE%A2%E5%90%8E%E5%8F%B0%E2%80%93Qexo/</url>
<content type="html"><![CDATA[<p>Qexo,一个快速、美观、强大的在线hexo管理器,支持使用 Vercel 零成本一键部署,,您只需要配置一个免费数据库。特色功能:自定义图床上传图片,在线配置编辑,在线页面管理,开放 API,自动检查更新,在线一键更新,快速接入友情链接,简单的说说短文,类似不算子的统计,自动填文章模板</p><p>官方地址:</p><p>GitHub:<a href="https://github.com/Qexo/Qexo">https://github.com/Qexo/Qexo</a></p><p>文档:<a href="https://www.oplog.cn/qexo/">https://www.oplog.cn/qexo/</a></p><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>这是我前段时间浏览一些博客发现的hexo在线管理器,主要是ui看着比较舒服,既然hexo自动化部署已经搞上了,顺便把后台也搞一个吧</p><h2 id="正文"><a href="#正文" class="headerlink" title="正文"></a>正文</h2><p>教程比较简单,跟着官方文档走就行了</p><p>我用的是Vercel 部署 (MySQL/PlanetScale)</p><h3 id="申请-PlanetScale-数据库(如果不能科学上网的请选择其他数据库)"><a href="#申请-PlanetScale-数据库(如果不能科学上网的请选择其他数据库)" class="headerlink" title="申请 PlanetScale 数据库(如果不能科学上网的请选择其他数据库)"></a>申请 PlanetScale 数据库(如果不能科学上网的请选择其他数据库)</h3><p><a href="https://www.planetscale.com/">注册 PlanetScale 账号</a> 创建免费 MySQL 数据库(==不支持大陆IP==), 区域<strong>一定要选择 AWS / N. Virginia (us-east-1)</strong>, 并记录数据库连接信息</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-16.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-16.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-16.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>复制下面全部数据库连接内容</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-15.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-15.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-15.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="一键部署"><a href="#一键部署" class="headerlink" title="一键部署"></a>一键部署</h3><p><a href="https://vercel.com/new/clone?repository-url=https://github.com/am-abudu/Qexo"><img src="https://vercel.com/button" class="lazyload placeholder" data-srcset="https://vercel.com/button" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp" alt="部署到 Vercel"></a></p><p>直接点文档的deploy,再选择GitHub存储库</p><p>首次部署会报错, 请无视并重新进入项目, 在项目设置界面添加环境变量 Environment Variables</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-17.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-17.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-17.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>最终添加的变量内容如下</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-18.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-18.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-18.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p><code>变量声明</code></p><table><thead><tr><th>名称</th><th>意义</th><th>示例</th></tr></thead><tbody><tr><td>MYSQL_HOST</td><td>MySQL 数据库连接地址</td><td>host的内容</td></tr><tr><td>MYSQL_PORT</td><td>MySQL 数据库通信端口 默认应填写 3306</td><td>3306</td></tr><tr><td>MYSQL_USER</td><td>MySQL 数据库用户名</td><td>username的内容</td></tr><tr><td>MYSQL_NAME</td><td>MySQL 数据库名</td><td>database的内容</td></tr><tr><td>MYSQL_PASSWORD</td><td>MySQL 数据库密码</td><td>password的内容</td></tr><tr><td>PLANETSCALE</td><td>(可选)用PlanetScale则设置为1</td><td>1</td></tr></tbody></table><h3 id="初始化引导"><a href="#初始化引导" class="headerlink" title="初始化引导"></a>初始化引导</h3><p>在 Deployments 点击 Redeploy 开始部署, 若没有 Error 信息即可打开域名进入初始化引导</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-20.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-20.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-20.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-19.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-19.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-19.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="Github-密钥"><a href="#Github-密钥" class="headerlink" title="Github 密钥"></a>Github 密钥</h3><p>于 <a href="https://github.com/settings/tokens">Github 设置</a> 生成的 Token (建议使用 Classic) 需要 Repo & Workflow 下的权限 <em>不建议给出所有权限</em></p><p><code>ghp_P8xxxxxxxxxxxxxxxxxxxxxxx</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-21.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-21.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-21.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="Vercel密钥"><a href="#Vercel密钥" class="headerlink" title="Vercel密钥"></a>Vercel密钥</h3><p>您的 Vercel 账户密钥 在 <a href="https://vercel.com/account/tokens">此处</a> 生成</p><p><code>xxxxxxxxxxxxxxxxxxxxxxxx</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-23.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-23.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-23.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h3 id="项目ID"><a href="#项目ID" class="headerlink" title="项目ID"></a>项目ID</h3><p>Qexo 部署所在项目的 ID 位于项目的 Settings -> General -> Project ID</p><p><code>prj_xxxxxxxxxxxxx</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-24.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-24.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-24.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-14.png" title="一个hexo博客后台--Qexo"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-14.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-14.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>最终大功告成</p>]]></content>
</entry>
<entry>
<title>利用Github Actions自动化部署 Hexo博客</title>
<link href="/2023/07/11/%E5%88%A9%E7%94%A8Github%20Actions%E8%87%AA%E5%8A%A8%E5%8C%96%E9%83%A8%E7%BD%B2%20Hexo%E5%8D%9A%E5%AE%A2/"/>
<url>/2023/07/11/%E5%88%A9%E7%94%A8Github%20Actions%E8%87%AA%E5%8A%A8%E5%8C%96%E9%83%A8%E7%BD%B2%20Hexo%E5%8D%9A%E5%AE%A2/</url>
<content type="html"><![CDATA[<h2 id="Github-Action自动化部署是什么"><a href="#Github-Action自动化部署是什么" class="headerlink" title="Github Action自动化部署是什么"></a>Github Action自动化部署是什么</h2><p>简单说,就是把hexo博客编译前的源代码上传到github代码仓库,Action在代码发生变动的时候,自动通过安装一系列nodejs环境和相关依赖,编译生成html页面到github pages仓库。</p><p>再简单点说,就是把本地生成博客的工作,全部交给Action执行。</p><p>好处就是随时随地都能修改或增加博文</p><h2 id="预览"><a href="#预览" class="headerlink" title="预览"></a>预览</h2><p><a href="https://1422756921.github.io/">https://1422756921.github.io/</a></p><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>之前搭建的hexo到现在都没怎么看过,今天准备清理电脑磁盘的时候就发现了hexo源码,现在有空打算弄个自动化,免得以后不小心删了。使用 GitHub Actions 实现将 Hexo 博客自动编译并发布到 GitHub Pages 上。顺便记录一下</p><h2 id="正文"><a href="#正文" class="headerlink" title="正文"></a>正文</h2><p>做自动化部署前,先搭建好hexo并部署到GitHub pages上(可以参考这篇<a href="https://blog.aerr.cn/825.html">https://blog.aerr.cn/825.html</a></p><p>先建一个私有仓库(myhexo),这个仓库存放的是编译前的文件,也就是你电脑本地的文件,这个仓库是拿来做自动化的</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>也就是一共两个仓库</p><ul><li>一个公有仓库存编译好的hexo(pages仓库,用户名例如是<code>1422756921.github.io</code>)</li><li>一个私有仓库存本地电脑编译前的文件(自动化仓库,用户名是<code>myhexo</code>)</li></ul><h3 id="上传编译前的代码"><a href="#上传编译前的代码" class="headerlink" title="上传编译前的代码"></a>上传编译前的代码</h3><p>创建完私有仓库后,在本地博客文件中复制几个文件到另外一个文件夹,其中包括<code>.github</code>,<code>scaffolds</code>,<code>source</code>,<code>themes</code>,<code>_config.yml</code>,<code>package.json</code>,<code>package-lock.json</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-1.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-1.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-1.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>还有一个很重要的一步:打开模板文件,把<code>.git</code>文件删除</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-2.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-2.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-2.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>然后回到根目录右键打开git bash</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-3.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-3.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-3.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>在git bash里依次输入以下命令</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">git init <span class="comment">#把这个目录变成Git可以管理的仓库</span></span><br><span class="line">git add . <span class="comment">#添加当前目录文件到缓存区(别漏命令后面的点)</span></span><br><span class="line">git commit -m <span class="string">"first commit"</span> <span class="comment">#提交缓存区内容到本地库,并备注first commit</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">#下面两条命令二选一,就行了</span></span><br><span class="line">git remote add origin https://github.com/用户名/自动化仓库名.git <span class="comment">#利用https关联远程仓库</span></span><br><span class="line">git remote add origin [email protected]:用户名/自动化仓库名.git <span class="comment">#利用ssh关联远程仓库</span></span><br><span class="line"> </span><br><span class="line">git push -u origin master <span class="comment">#把本地库的所有内容推送到远程库上</span></span><br></pre></td></tr></table></figure><p>同样<code>SSH</code>和<code>HTTPS</code>均可。<code>SSH</code>在绑定过<code>ssh key</code>的设备上无需再输入密码,<code>HTTPS</code>则需要输入密码,但是<code>SSH</code>偶尔会遇到端口占用的情况。</p><h3 id="获取-Github-token"><a href="#获取-Github-token" class="headerlink" title="获取 Github token"></a>获取 Github token</h3><p>打开<a href="https://github.com/settings/tokens">https://github.com/settings/tokens</a><br>点击 Generate new token 新建个 token</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-4.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-4.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-4.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>note随便填,Expiration选择No expiration,勾选repo和workflow,其他没什么了,然后点生成就好了</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-5.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-5.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-5.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>把token复制下来</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-6.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-6.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-6.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>打开自动化仓库的<code>Settings<span> </span></code>-> <code>Secrets and variables</code> -> <code>Actions</code> -> <code>New repository secret</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-7.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-7.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-7.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>一共有三个变量名<code>GITHUBTOKEN</code>,<code>GITHUBUSERNAME</code>,<code>GITHUBEMAIL</code>,逐一添加</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-8.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-8.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-8.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-9.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-9.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-9.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><h5 id="变量声明"><a href="#变量声明" class="headerlink" title="变量声明"></a>变量声明</h5><table><thead><tr><th>变量名</th><th>常量释义</th></tr></thead><tbody><tr><td>GITHUBMAIL</td><td>Github 用户邮箱地址</td></tr><tr><td>GITHUBTOKEN</td><td>Github token</td></tr><tr><td>GITHUBUSERNAME</td><td>Github 用户名</td></tr></tbody></table><h3 id="添加workflows"><a href="#添加workflows" class="headerlink" title="添加workflows"></a>添加workflows</h3><p>接下来点击<code>Actions<span> </span></code>-> <code>set up a workflow yourself</code></p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-10.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-10.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-10.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>复制以下代码到里面</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br></pre></td><td class="code"><pre><span class="line">name: 自动部署</span><br><span class="line"> </span><br><span class="line">on:</span><br><span class="line"> push:</span><br><span class="line"> branches:</span><br><span class="line"> - main</span><br><span class="line"> </span><br><span class="line"> release:</span><br><span class="line"> types:</span><br><span class="line"> - published</span><br><span class="line"> </span><br><span class="line"><span class="built_in">jobs</span>:</span><br><span class="line"> deploy:</span><br><span class="line"> runs-on: ubuntu-latest</span><br><span class="line"> steps:</span><br><span class="line"> - name: 检查分支</span><br><span class="line"> uses: actions/checkout@v2</span><br><span class="line"> with:</span><br><span class="line"> ref: main</span><br><span class="line"> </span><br><span class="line"> - name: 安装 Node</span><br><span class="line"> uses: actions/setup-node@v1</span><br><span class="line"> with:</span><br><span class="line"> node-version: <span class="string">"16.x"</span></span><br><span class="line"> </span><br><span class="line"> - name: 安装 Hexo</span><br><span class="line"> run: |</span><br><span class="line"> <span class="built_in">export</span> TZ=<span class="string">'Asia/Shanghai'</span></span><br><span class="line"> npm install hexo-cli -g</span><br><span class="line"> </span><br><span class="line"> - name: 缓存 Hexo</span><br><span class="line"> uses: actions/cache@v1</span><br><span class="line"> id: cache</span><br><span class="line"> with:</span><br><span class="line"> path: node_modules</span><br><span class="line"> key: <span class="variable">${{runner.OS}</span>}-<span class="variable">${{hashFiles('**/package-lock.json')}</span>}</span><br><span class="line"> </span><br><span class="line"> - name: 安装依赖</span><br><span class="line"> <span class="keyword">if</span>: steps.cache.outputs.cache-hit != <span class="string">'true'</span></span><br><span class="line"> run: |</span><br><span class="line"> npm install --save</span><br><span class="line"> </span><br><span class="line"> - name: 生成静态文件</span><br><span class="line"> run: |</span><br><span class="line"> hexo clean</span><br><span class="line"> hexo generate</span><br><span class="line"> </span><br><span class="line"> - name: 部署 <span class="comment">#此处master:master 指从本地的master分支提交到远程仓库的master分支(不是博客的分支写master即可),若远程仓库没有对应分支则新建一个。如有其他需要,可以根据自己的需求更改。</span></span><br><span class="line"> run: |</span><br><span class="line"> <span class="built_in">cd</span> ./public</span><br><span class="line"> git init</span><br><span class="line"> git config --global user.name <span class="string">'${{ secrets.GITHUBUSERNAME }}'</span></span><br><span class="line"> git config --global user.email <span class="string">'${{ secrets.GITHUBEMAIL }}'</span></span><br><span class="line"> git add .</span><br><span class="line"> git commit -m <span class="string">"<span class="variable">${{ github.event.head_commit.message }</span>} <span class="subst">$(date +<span class="string">"%Z %Y-%m-%d %A %H:%M:%S"</span>)</span> Updated By Github Actions"</span></span><br><span class="line"> git push --force --quiet <span class="string">"https://<span class="variable">${{ secrets.GITHUBUSERNAME }</span>}:<span class="variable">${{ secrets.GITHUBTOKEN }</span>}@github.com/<span class="variable">${{ secrets.GITHUBUSERNAME }</span>}/<span class="variable">${{ secrets.GITHUBUSERNAME }</span>}.github.io.git"</span> master:master <span class="comment"># GitHub配置</span></span><br><span class="line"> git push --force --quiet <span class="string">"https://<span class="variable">${{ secrets.TOKENUSER }</span>}:<span class="variable">${{ secrets.CODINGTOKEN }</span>}@e.coding.net/<span class="variable">${{ secrets.CODINGUSERNAME }</span>}/<span class="variable">${{ secrets.CODINGBLOGREPO }</span>}.git"</span> master:master <span class="comment"># coding配置</span></span><br><span class="line"> git push --force --quiet <span class="string">"https://<span class="variable">${{ secrets.GITEEUSERNAME }</span>}:<span class="variable">${{ secrets.GITEETOKEN }</span>}@gitee.com/<span class="variable">${{ secrets.GITEEUSERNAME }</span>}/<span class="variable">${{ secrets.GITEEUSERNAME }</span>}.git"</span> master:master <span class="comment"># gitee配置</span></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>==<strong>上方代码配置包含 gitee 和 coding,请自行删减</strong>==</p><p>粘贴上去后点击Commit changes…</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-11.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-11.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-11.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>就大功告成了,可以点击Actions查看运行进程了</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-12.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-12.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-12.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p><p>最后,需要到GitHub pages那个仓库里面把默认页改成master就好了</p><p><a href="https://blog.aerr.cn/wp-content/uploads/2023/07/image-13.png" title="利用Github Actions自动化部署 Hexo博客"><img src="https://blog.aerr.cn/wp-content/uploads/2023/07/image-13.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2023/07/image-13.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></a></p>]]></content>
</entry>
<entry>
<title>Hexo博客搭建</title>
<link href="/2021/11/24/Hexo%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/"/>
<url>/2021/11/24/Hexo%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/</url>
<content type="html"><![CDATA[<p>Hexo是个快速、简洁且高效的博客框架,它是一款基于Node.js的静态博客生成程序,作者是中国台湾tommy351。它的安装运行等甚至生成文章页面 生成目录,网站配置都是在爱代码模式下进行的。还有就是要学会使用Hexo,就得学会使用Git,并且对Git常用基础命令要有所了解,还有就是需要安装Node.js,这个软件是Hexo本地搭建必不可少的工具,值得一提的是Hexo博客可以部署到GitHub、Gitee、GitLab、Coding、七牛,都是完全免费的,可以让你实现免服务器,免域名搭建一个完整的博客。</p><p>Hexo官网:<a href="https://hexo.io/">https://hexo.io</a></p><h2 id="1-安装Git"><a href="#1-安装Git" class="headerlink" title="1. 安装Git"></a>1. 安装Git</h2><p>Git是目前世界上最先进的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。也就是用来管理你的hexo博客文章,上传到GitHub的工具。</p><p>Windows:下载并安装 git:<a href="https://git-scm.com/download/win">https://git-scm.com/download/win</a><br>对于中国大陆地区用户,可以前往 淘宝 Git for Windows 镜像 下载 git 安装包。</p><p>Linux (Ubuntu, Debian):sudo apt-get install git-core<br>Linux (Fedora, Red Hat, CentOS):sudo yum install git-core</p><h2 id="2-安装nodejs"><a href="#2-安装nodejs" class="headerlink" title="2. 安装nodejs"></a>2. 安装nodejs</h2><p>Hexo是基于nodeJS编写的,所以需要安装一下nodeJs和里面的npm工具。</p><p>windows:打开nodejs:<a href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a> 选择LTS版本。</p><p>linux:安装完后,打开命令行</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install nodejs</span><br><span class="line">sudo apt-get install npm</span><br></pre></td></tr></table></figure><p>然后检查一下有没有安装成功</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br><span class="line">npm -v</span><br></pre></td></tr></table></figure><h2 id="3-安装hexo"><a href="#3-安装hexo" class="headerlink" title="3. 安装hexo"></a>3. 安装hexo</h2><p>然后安装hexo,你可以先创建一个文件夹blog,在这个文件夹下的空白地方,右键git bash打开</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli</span><br></pre></td></tr></table></figure><p>然后初始化hexo,这个hexoblog可以随便填</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init hexoblog</span><br></pre></td></tr></table></figure><p>用cd进入hexoblig里(或者直接打开这个文件夹,在空白地方右键 git bash打开 )</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> hexoblog</span><br></pre></td></tr></table></figure><p>这个时候hexoblog文件夹里有指定文件夹目录下有:<br>node_modules: 依赖包<br>public:存放生成的页面<br>scaffolds:生成文章的一些模板<br>source:用来存放你的文章<br>themes:主题<br>_config.yml: 博客的配置文件<br>db.json:source解析所得到的<br>package.json:项目所需模块项目的配置信息</p><p>然后本地运行测试一下</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo generate</span><br><span class="line">hexo server</span><br></pre></td></tr></table></figure><p>hexo generate 顾名思义,生成静态文章,可以用 hexo g缩写<br>hexo server 顾名思义,启动服务 本地运行,可以用 hexo s缩写</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-26.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-26.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><p>在浏览器输入 localhost:4000 就可以看到你生成的博客了。</p><p>使用ctrl+c可以把服务关掉。</p><h2 id="4-在GitHub创建一个放博客文件的仓库"><a href="#4-在GitHub创建一个放博客文件的仓库" class="headerlink" title="4.在GitHub创建一个放博客文件的仓库"></a>4.在GitHub创建一个放博客文件的仓库</h2><p>GitHub官网:<a href="https://github.com/">https://github.com/</a></p><p>没有账号的注册一个,登录后,点击右上角New repository</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-22.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-22.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><p>创建一个和你用户名相同的仓库,后面加.github.io,只有这样,将来要部署到GitHub page的时候,才会被识别,也就是xxx.github.io,其中xxx就是你注册GitHub的用户名。我这里是已经建过了。点击create repository。</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-25.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-25.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><h2 id="5-生成SSH添加到GitHub"><a href="#5-生成SSH添加到GitHub" class="headerlink" title="5. 生成SSH添加到GitHub"></a>5. 生成SSH添加到GitHub</h2><p>在博客根目录 右键点击 Git Bash Here</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-23.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-23.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><p>输入命令</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name <span class="string">"yourname"</span></span><br><span class="line">git config --global user.email <span class="string">"youremail"</span></span><br></pre></td></tr></table></figure><p>yourname输入你GitHub用户名,youremail输入你GitHub的邮箱。(在双引号里面输入,双引号别删)</p><p>检查一下你有没有输对</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config user.name</span><br><span class="line">git config user.email</span><br></pre></td></tr></table></figure><p>输入下面命令( youremail 是GitHub邮箱)创建SSH ,然后一路回车</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C <span class="string">"youremail"</span></span><br></pre></td></tr></table></figure><p>在你的C盘中找到这个文件夹。打开 id_rsa.pub</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-24.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-24.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><p>其中,id_rsa是你这台电脑的私人秘钥,不能给别人看的,id_rsa.pub是公共秘钥,可以随便给别人看。把这个公钥放在GitHub上,这样当你链接GitHub自己的账户时,它就会根据公钥匹配你的私钥,当能够相互匹配时,才能够顺利的通过git上传你的文件到GitHub上。</p><p>点击GitHub的右上角setting中 -> 点击左边SSH and GPG keys -> 点击New SSH key<br>title随便填,把C盘的id_rsa.pub里面的信息复制到key里。</p><p><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/image-27-1024x700.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/image-27-1024x700.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"><br><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/[email protected]" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/[email protected]" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"><br><img src="https://blog.aerr.cn/wp-content/uploads/2021/11/OI2Y6UYX1Z60SMYUN-1024x629.png" class="lazyload placeholder" data-srcset="https://blog.aerr.cn/wp-content/uploads/2021/11/OI2Y6UYX1Z60SMYUN-1024x629.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><p>回到git bash中,查看是否成功</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -T [email protected]</span><br></pre></td></tr></table></figure><p>这个时候要输入一次yes,然后再回车</p><h2 id="6-将hexo部署到GitHub"><a href="#6-将hexo部署到GitHub" class="headerlink" title="6. 将hexo部署到GitHub"></a>6. 将hexo部署到GitHub</h2><p>打开站点配置文件 _config.yml,拉到最后,修改为<br>1422756921就是你的GitHub账户</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line"> <span class="built_in">type</span>: git</span><br><span class="line"> repo: [email protected]:1422756921/1422756921.github.io.git</span><br><span class="line"> branch: main</span><br></pre></td></tr></table></figure><p>注意:现在GitHub的默认分支已经是main了,不是master !!!!</p><p>这个时候需要先安装deploy-git ,也就是部署的命令,这样你才能用命令部署到GitHub。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure><p>然后</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo clean</span><br><span class="line">hexo g</span><br><span class="line">hexo deploy</span><br></pre></td></tr></table></figure><p>其中 hexo clean清除了你之前生成的东西<br>hexo deploy 部署文章,可以用hexo d缩写</p><p>输入hexo deploy之后会出现一个小弹窗,要你输入GitHub的username和password。(用户名是邮箱)</p><p>过一会儿就可以在<a href="https://1422756921.github.io/">https://1422756921.github.io</a> 这个网站看到你的博客了!</p><p>关于站点文件配置请参考官方文档:<a href="https://hexo.io/zh-cn/docs/configuration.html">https://hexo.io/zh-cn/docs/configuration.html</a></p>]]></content>
</entry>
<entry>
<title>把博客从GitHub迁移到Gitee</title>
<link href="/2021/11/22/%E6%8A%8A%E5%8D%9A%E5%AE%A2%E4%BB%8EGitHub%E8%BF%81%E7%A7%BB%E5%88%B0Gitee/"/>
<url>/2021/11/22/%E6%8A%8A%E5%8D%9A%E5%AE%A2%E4%BB%8EGitHub%E8%BF%81%E7%A7%BB%E5%88%B0Gitee/</url>
<content type="html"><![CDATA[<h2 id="原因:"><a href="#原因:" class="headerlink" title="原因:"></a>原因:</h2><p>Github是基于 Git 做版本控制的代码托管平台,同时也是全球最大的代(同)码(性)托(交)管(友)网站。<br>喜欢用GitHub的都知道,时常出现抽风现象,包括Pages功能也是<br>如果你把网站托管到GitHub上,某天你想让用户浏览,用户跟你反映打开特别慢或者直接打不开,你能忍?shi都能吃,好吧<br>就因为前几天刚搭建完Hexo博客后想分享给别人浏览,然而有些人反馈说打开慢的要死。<br>换作是我,20秒都还没打开的网页,我直接退出去,反正我受不了<br>GitHub:<a href="https://1422756921.github.io/">https://1422756921.github.io</a> 迁移到 Gitee:<a href="https://a1422756921.gitee.io/">https://a1422756921.gitee.io</a></p><h2 id="导入"><a href="#导入" class="headerlink" title="导入"></a>导入</h2><p>打开Gitee官网,选择导入Github仓库,找到GitHub那个博客仓库,导入到开通了Pages的gitee仓库里面<br><img src="https://gitee.com/a1422756921/fontawesome/raw/main/NKKLD~1%7DO$~%60T04(WIM1XJ1.png" class="lazyload placeholder" data-srcset="https://gitee.com/a1422756921/fontawesome/raw/main/NKKLD~1%7DO$~%60T04(WIM1XJ1.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"></p><h2 id="体验"><a href="#体验" class="headerlink" title="体验"></a>体验</h2><p>Gitee开通Pages服务要手持身份证实名的,但Gitee在国内的访问体验是一流的<br>经过这两天的体验和测试,发现ping值都是在50ms左右,丢包率为零<br><img src="https://gitee.com/a1422756921/fontawesome/raw/main/(QHNADAWZQT81A67LKAIRV5.png" class="lazyload placeholder" data-srcset="https://gitee.com/a1422756921/fontawesome/raw/main/(QHNADAWZQT81A67LKAIRV5.png" srcset="https://pic1.zhimg.com/v2-cd38920285d125be80b3eb504052c550_b.webp"><br>体验因地域、网络提供商而异,Gitee 在国内无论在访问速度还是稳定性上都非常优秀</p>]]></content>
</entry>
<entry>
<title>关于博客的事</title>
<link href="/2021/11/20/%E5%85%B3%E4%BA%8E%E5%8D%9A%E5%AE%A2%E7%9A%84%E4%BA%8B/"/>
<url>/2021/11/20/%E5%85%B3%E4%BA%8E%E5%8D%9A%E5%AE%A2%E7%9A%84%E4%BA%8B/</url>
<content type="html"><![CDATA[<h2 id="Hexo博客"><a href="#Hexo博客" class="headerlink" title="Hexo博客"></a>Hexo博客</h2><p>Hello,这里是青云依兮的Hexo博客,是我所有站点中唯一一个不怕被攻击的</p><p>Hexo是个快速、简洁且高效的博客框架,它是一款基于Node.js的静态博客生成程序,作者是中国台湾tommy351。</p><p>它的安装运行等甚至生成文章页面 生成目录,网站配置都是在爱代码模式下进行的。还有就是要学会使用Hexo,就得学会使用Git,并且对Git常用基础命令要有所了解,还有就是需要安装Node.js,这个软件是Hexo本地搭建必不可少的工具,值得一提的是Hexo博客可以部署到GitHub、Gitee、GitLab、Coding、七牛,都是完全免费的,可以让你实现免服务器,免域名搭建一个完整的博客。</p>]]></content>
</entry>
<entry>
<title>Hello World</title>
<link href="/2021/11/18/hello-world/"/>
<url>/2021/11/18/hello-world/</url>
<content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
</entry>
</search>