程式筆記
Javascript
hexo
Hexo升級V5排除疑難雜症
K
kidneyweakx
March 18, 2021 (Updated: December 18, 2025)
因為剛好把電腦重灌,然後這個blog就躺在D槽等著我幫他換新的環境,然後他就被我快樂的升級了。
bash
hexo: 5.4.0
hexo-cli: 4.2.0
os: Windows 10 20H2
node: 14.16.0
# hexo 更新V5.0
hexo 更新到V5的步驟相當容易
bash
npm install -g npm-upgrade
npm-upgrade
npm i
就可以自動更新了,但是版本大更新,往往都會附帶一些小問題,像他就給我了幾個warning
# 更新後Error
bash
Deprecated config detected: "external_link" with a Boolean value is deprecated. See https://hexo.io/docs/configuration for more details.
# 解決方法
修改_config.yml的部分成新版的,原始external_link只有true的選項,更新後可決定是否開啟新分頁
yaml
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
# 修改這個部分
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
prismjs:
enable: false
preprocess: true
line_number: true
tab_replace: ''
# hexo-git-backup push出錯
這次更新也讓我使用的hexo-git-backup module出現大問題
bash
error: src refspec master does not match any
error: failed to push some refs to 'github'
這個問題在 issue#40 有人做解答
大概解決大概解決方式如下,在node_module/hexo-git-backup中找到上面那行,並把master改成backup,畢竟自己的branch是backup,所以沒辦法找到
jsx
// 找到這行
// commands.push(['push', '-u', t, 'master:' + repo[t].branch, '--force']);
// 更換成這行
commands.push(['push', '-u', t, 'backup:' + repo[t].branch, '--force']);
Related Articles
→
LOG-934
C# 用VID和PID自動連線serialport
> 原本C#的serial port function官方範例,是類似這樣的
[程式筆記][C#]
@kidneyweakx→
LOG-941
Golang Json解析問題 Struct字首大小寫
> 其實這還蠻有趣的,最近在玩golang的爬蟲,高效率的編譯和好用的colly真的還挺好上手的,但是畢竟爬蟲還是要encode成Json才好做跨平台處理。
[程式筆記][Golang]
@kidneyweakx→
LOG-929
NDK編譯動態庫.so錯誤 executing external native build for cmake
> 剛好在把C++的動態庫加入flutter中,想說寫個Native Java版試試看,結果遇到了這種鬼問題😱😱😱。
[程式筆記][Javascript]
@kidneyweakx