難道做網(wǎng)站必須用vue框架嗎系統(tǒng)優(yōu)化軟件哪個(gè)好
以下相關(guān)講解均基于hexo + github pages方案,請(qǐng)注意!!!
博客搭建方案選擇
- 參考文章1
搭建教程
- 參考文章1
hexo + github pages搭建過(guò)程中遇到的問(wèn)題
刪除categories、tags
1、刪除含有需要?jiǎng)h除categories、tags的文章
2、hexo clean
3、hexo s
4、hexo g
Support for password authentication was removed on August 13, 2021. Please use a personal access token instead
- github 不再支持password,必須使用Personal access tokens
- 參考文章1
No layout: index.html
- 可能是主題未正確安裝的問(wèn)題
- 安裝主題參考
fatal: in unpopulated submodule ‘.deploy_git’
- 刪除.deploy_git(rm -rf .deploy_git/),然后重新hexo d
git push 需要輸入用戶(hù)名密碼問(wèn)題
- 需要改成token方式:
- git remove -v: 查看當(dāng)前origin配置
- git remote remove origin:移除origin配置
- git remove -v:再次查看origin配置
- git remote add origin https://你的token@github.com/liquangang/liquangang.github.io.git
- git remote -v:查看是否修改成功
hexo d 推動(dòng)失敗
- 一種可能:依然是git配置問(wèn)題,需要修改_config.yml文件中的git配置(deploy->repo),此處與git的正常配置一樣,即設(shè)置origin(舉例:https://你的token@github.com/liquangang/liquangang.github.io.git)
- 另一種可能: 代碼庫(kù)地址配置的是http格式,換成ssh格式,然后重新配置一遍ssh key就行了(傷心&激動(dòng),搞了好久,一直在搞http格式的,一直沒(méi)成功,不過(guò)我覺(jué)得http的也行,因?yàn)橹拔矣玫木褪莌ttp格式,不知道這次為什么不行了,總之現(xiàn)在確定ssh形式可以)
hexo clean 等提示 node-sass問(wèn)題
- 參考文章
- 原因:node源不穩(wěn)定
- 解決:切換國(guó)內(nèi)源(npm install -g cnpm --registry=https://registry.npm.taobao.org),然后使用cnpm命令執(zhí)行操作
err: Error: Spawn failed
- 解決:
- 刪除.deploy_git目錄
- git config --global core.autocrlf false
- hexo clean && hexo g && hexo d
Node Sass could not find a binding for your current environment
- node跟npm的版本不對(duì)應(yīng)問(wèn)題,嘗試重新安裝即可
sudo cnpm install hexo-renderer-sass --save 執(zhí)行失敗
- 刪除目錄下的package.json 重試即可
顯示can not get /
- 執(zhí)行sudo cnpm install 即可
Cannot read properties of undefined (reading ‘enable’)
- 刪除主題git文件,重新clone一份
hexo landscape 主題 本地搜索功能
- 參考文章
技巧
如何保存原始文章:
- 目前筆者采用的方式是,在github上新建一個(gè)專(zhuān)門(mén)用來(lái)保存原始文章的分支,然后將原始文章push到這個(gè)分支上
- push腳本:
hexo clean;git add .;git commit -m "博客文章更新";git push;hexo g;hexo d;hexo clean;