程式筆記
Javascript
hexo
Hexo 升級 V5 排除疑難雜症
K
kidneyweakx
March 18, 2021 (Updated: June 2, 2026)
因為剛好把電腦重灌,然後這個 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-DC6
No File is an Island: Unraveling Swift Dependencies and Architecture
> 在 Swift 的世界中,我們習慣了強大的 Xcode 和簡潔的語法,但隨著專案規模的成長,一個隱形的怪獸會開始在程式碼中徘徊:那就是失控的依賴關係
[程式筆記][Swift]
@kidneyweakx→
LOG-FE5
Saved by the Logs: How to Recover a Forgotten Keystore Password via IDE Build Logs.
> 最遙遠的距離,是密碼就在 IDE 裡但我看不見
[程式筆記][Android]
@kidneyweakx→
LOG-934
C# 用 VID 和 PID 自動連線 serialport
> 原本 C 的 serial port function官方範例,是類似這樣的 這種方法每次開啟都還要再去跟改port相當的麻煩,所以就找了別人針對windows寫的function,再返回靜態的 port string 給 ,效果相當好。 完整內容可參照下方連結😁 code來源
[程式筆記][C#]
@kidneyweakx