~themes/next/_config.yml
找到sidebar
字段scrollpercent
的屬性改成true
便可, 以下:sidebar:
# Sidebar Position - 側欄位置(只對Pisces | Gemini兩種風格有效)
position: left //靠左放置
#position: right //靠右放置
# Sidebar Display - 側欄顯示時機(只對Muse | Mist兩種風格有效)
#display: post //默認行爲,在文章頁面(擁有目錄列表)時顯示
display: always //在全部頁面中都顯示
#display: hide //在全部頁面中都隱藏(能夠手動展開)
#display: remove //徹底移除
offset: 12 //文章間距(只對Pisces | Gemini兩種風格有效)
b2t: false //返回頂部按鈕(只對Pisces | Gemini兩種風格有效)
scrollpercent: true //返回頂部按鈕的百分比
複製代碼
正常狀況下, 咱們博客的相關配置信息都是在本地的, 並未上傳服務器, 這樣當咱們想在其餘設備, 好比公司的電腦或者原電腦重裝了系統, 那麼咱們便沒法再維護咱們的博客了node
Node.js
git
hexo
hexo
生成的靜態博客文件都是上傳到GitHub
上的, 且默認放在master
分支上, 而一些相關的配置文件都在本地hexo
的源文件(部署環境文件)能夠都放在hexo
分支上(能夠新建立一個hexo
分支),換新電腦時,直接git clone hexo
分支username.github.io
倉庫新建hexo
分支在Github
的username.github.io
倉庫上新建一個hexo
(分支名字可自定義)分支, 在下圖箭頭位置輸入分支名字,回車便可建立成功git
切換到該hexo
分支,並在該倉庫->Settings->Branches->Default branch
中將默認分支設爲hexo
,save
保存github
Github
該步驟須要在搭建博客的電腦上操做(博客配置文件和主題配置文件所在的電腦上操做)npm
hexo
分支hexo
分支克隆到本地, 在終端中cd
進入該username.github.io
文件目錄Git Bash
執行git branch
命令查看當前所在分支,應爲新建的分支hexo
Sourcetree
軟件管理代碼的話, 克隆到本地的項目可能沒有username.github.io
層級, 全部文件都在根目錄下, 操做上都不影響, 只須要記住操做要在文件的根目錄下便可$ git branch
*hexo
複製代碼
Hexo
目錄下的所有文件)所有拷貝進username.github.io
文件目錄中去npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save
npm install hexo-generator-search --save
npm install hexo-generator-searchdb --save
複製代碼
hexo
分支git clone
下來該主題的最新版本,而後將內容拷到當前主題目錄便可hexo
分支
master
分支和hexo
分支各自保存着一個版本,master
分支用於保存博客靜態資源,提供博客頁面供人訪問;hexo
分支用於備份博客部署文件,供本身維護更新,二者在一個GitHub
倉庫內也不會有任何衝突服務器
ssh key
添加到GitHub
帳戶上
ssh key
的配置方式可參考基於GitHub和Hexo搭建我的博客username.github.io
倉庫的hexo
分支到本地,此時本地git
倉庫處於hexo
分支username.github.io
目錄,執行npm install
(因爲倉庫有一個.gitignore
文件,裏面默認是忽略掉 node_modules
文件夾的,也就是說倉庫的hexo
分支並無存儲該目錄,因此須要install
下)
node_modules
文件沒有丟失, 可不執行該操做hexo
分支git pull
拉取一下最新的更新說到這裏全部的相關問題基本也都解決了hexo