~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