git推送超时问题

2023/9/19 git推送超时问题

在vccode中推送git到github超时,无法推送
输出显示ssh: connect to host ssh.github.com port 443: Connection timed out fatal: Could not read from remote repository.

git推送超时问题1.png

在网上搜索终于找到解决办法

首先在https://ipaddress.com/website/ssh.github.com网站中查询ip

git推送超时问题2.png

查出来ssh.github.com的IP是 140.82.112.35

知道ip后,接下来测试下ssh是否可以连上改ip

1
ssh -T -p 443 git@140.82.114.36

git推送超时问题3.png

如果看到最后一行 Hi xxxx 就说明没问题。

这时候,找到当前用户目录下的.ssh/config 文件,如果没有就自己建一个。只要将Hostname ssh.github.com换成ip地址140.82.112.35即可

git推送超时问题4.png

最后重新push代码,大功告成

git推送超时问题5.png

bilibili-card

2023/9/9 bilibili-card插件安装

安装

1
npm i hexo-bilibili-card

卸载

1
npm uninstall hexo-bilibili-card

示例

1
{% bilicard BV1vs411D7JZ %}

《紫罗兰永恒花园-剧场版》——一封信纸

此插件要求node版本在18.x以上,如生成不成功请检查node版本

如果使用GitHub action自动部署请注意.github/autodeploy.yml的node版本,版本不对也无法部署成功

作者人非常好,很有耐心

修改卡片文章背景透明度

2023/4/27 修改卡片文章背景透明度

在主题页面的themes\butterfly\source\css中新建css文件

复制代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* 文章页背景 */
.layout_post>#post {
/* 以下代表透明度为0.97 可以自行修改*/
background: rgba(255,255,255,.97);
}

/* 所有页面背景 */
#aside_content .card-widget, #recent-posts>.recent-post-item, .layout_page>div:first-child:not(.recent-posts), .layout_post>#page, .layout_post>#post, .read-mode .layout_post>#post{
background: rgba(255,255,255,.97);
}
/*侧边卡片的透明度 */
:root {
--card-bg: rgba(255, 255, 255, .97);
}

在主题配置文件_config.yml引入css文件,全局检索inject,在以下head位置插入字段

修改卡片透明度.png

GitHub action自动部署

2023/4/24 配置GitHub action自动部署

可废了我的老命了,能碰到的问题几乎碰了个遍
根据这位安知鱼云up的视频的拼做了大半遇到问题然后参考了参考了Akilar的博客顺利部署了

  • 修改’node_modules’等文件不能自动部署

随机背景图

2023/4/11 随机背景图

首先必须设置网站背景图,在主题配置中找到并且配置。我这里是配置成了'#efefef'

1
2
3
4
5
6
7
# Website Background (設置網站背景)

# can set it to color or image (可設置圖片 或者 顔色)

# The formal of image: url(http://xxxxxx.com/xxx.jpg)

background: '#efefef'

配置之后,主页使用#web_bg的div来存放背景图片,使用#page-header来存放banner图片。使用js随机选择一张图片,然后根据id取值重设即可做到每次切换或刷新时,随机背景图片。

我这里在blog\themes\butterfly\source\js下新建了randombackground.js文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//随机背景图片数组,图片可以换成图床链接,注意最后一条后面不要有逗号

var backimg =[

"url(/img/bg1.JPG)",

"url(/img/bg2.jpg)",

"url(/img/bg3.jpg)",

"url(/img/bg4.jpg)"

];

//获取背景图片总数,生成随机数

var bgindex =Math.floor(Math.random() * (backimg.length));

//重设背景图片

document.getElementById("web_bg").style.backgroundImage = backimg[bgindex];

最后在主题配置文件中引入js

1
2
3
4
5
6
inject:

head:

bottom:
- <script async data-pjax src="/js/randombackground.js"></script>

关闭aplayer歌词显示

2023/4/11 关闭aplayer歌词显示

关闭aplayer歌词显示,但即使点击展开界面的歌词按钮也不会显示歌词,使用data-lrctype="0"参数即可,完整代码为

1
2
3
4
inject:
head:
bottom:
- <div class="aplayer no-destroy" data-id="2614181546" data-server="tencent" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="true" data-order="random" data-preload="none" data-autoplay="false" data-lrctype="0" muted></div>

重装系统转移博客到新本地

2022/6/18 重装系统转移hexo

大体跟着小嘉的教程完成,但有几个bug需要修

  • hexo图片路径问题

生成时会出现

update link as:–>/.io//06/01/vim/1561905818946.png
update link as:–>/.io//06/01/vim/1561905818946.png

根据a1oyss 2的帖子在这里找到方法解决

  • Git提交时提示

The file will have its original line endings in your working directory

根据phper_陈普的方法解决

  • 生成和部署时出现

Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db

根据前端司南的帖子

输入

1
npm update caniuse-lite

即可