github+hexo搭建本身的博客網站(二)更換主題yilia

開始更換主題,hexo默認的主題是landscape,能夠更換爲其餘的主題yilia主題html

如何對如何搭建hexo+github能夠查看我第一篇入門文章:http://www.cnblogs.com/chengxs/p/7402174.html前端

詳細的能夠查看hexo博客的演示:https://saucxs.github.io/git

能夠查看在github上生成的靜態文件:https://github.com/saucxs/saucxs.github.io.git,若是以爲能夠請給顆星星。github

 

下面貼出github上star數量最多的前10個主題:segmentfault

1.iissnan/hexo-theme-next, 3510個star。
2.litten/hexo-theme-yilia, 1703個star。
3.TryGhost/Casper, 679個star。
4.wuchong/jacman, 503個star。
5.A-limon/pacman, 431個star。
6.daleanthony/uno, 416個star。
7.orderedlist/modernist, 367個star。
8.AlxMedia/hueman, 336個star。
9.kathyqian/crisp-ghost-theme, 303個star。
10.xiangming/landscape-plus, 287個star。服務器

 

一、clone主題代碼微信

在根目錄下執行hexo

$ git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

 

二、修改配置文件app

修改根目錄下的_config.yml文件:ide

theme: yilia    //默認爲landscape

 

三、修改themes/yilia/_config.yml文件:

修改成:

# Header

menu:
  主頁: /
  全部文章: /allPages
  隨筆: /tags
  相冊: /photos

# SubNav
subnav:
  github: "https://github.com/saucxs"
  weibo: "#"
  rss: /atom.xml
  zhihu: "#"
  #qq: "#"
  #weixin: "#"
  #jianshu: "#"
  #douban: "#"
  #segmentfault: "#"
  #bilibili: "#"
  #acfun: "#"
  #mail: "mailto:litten225@qq.com"
  #facebook: "#"
  #google: "#"
  #twitter: "#"
  #linkedin: "#"



# 是否須要修改 root 路徑
# 若是您的網站存放在子目錄中,例如 http://yoursite.com/blog,
# 請將您的 url 設爲 http://yoursite.com/blog 並把 root 設爲 /blog/。
root:

# Content

# 文章太長,截斷按鈕文字
excerpt_link: 閱讀全文
# 文章卡片右下角常駐連接,不須要請設置爲false
show_all_link: '展開全文'
# 數學公式
mathjax: false
# 是否在新窗口打開連接
open_in_new: false
fancybox: true
#是否開啓動畫效果
animate: true

# 打賞
# 打賞type設定:0-關閉打賞; 1-文章對應的md文件裏有reward:true屬性,纔有打賞; 2-全部文章均有打賞
reward_type: 2
# 打賞wording
reward_wording: '謝謝你請我吃糖果'
# 支付寶二維碼圖片地址,跟你設置頭像的方式同樣。好比:/assets/img/alipay.jpg
alipay: /assets/img/alipay.jpg
# 微信二維碼圖片地址
weixin: /assets/img/wechat.png

# 目錄
# 目錄設定:0-不顯示目錄; 1-文章對應的md文件裏有toc:true屬性,纔有目錄; 2-全部文章均顯示目錄
toc: 1
# 根據本身的習慣來設置,若是你的目錄標題習慣有標號,置爲true便可隱藏hexo重複的序號;不然置爲false
toc_hide_index: true
# 目錄爲空時的提示
toc_empty_wording: '目錄,不存在的…'

# 是否有快速回到頂部的按鈕
top: true

# Miscellaneous
baidu_analytics: ''
google_analytics: ''
favicon: /favicon.png

#你的頭像url
avatar:

#是否開啓分享
share_jia: true
share_addthis: false

#評論:一、多說;二、網易雲跟帖;三、暢言;4、Disqus 不須要使用某項,直接設置值爲false,或註釋掉
#具體請參考wiki:https://github.com/litten/hexo-theme-yilia/wiki/

#1、多說
duoshuo: false

#2、網易雲跟帖
wangyiyun: false

#3、暢言
changyan_appid: false
changyan_conf: false

#4、Disqus 在hexo根目錄的config裏也有disqus_shortname字段,優先使用yilia的
disqus: false

# 樣式定製 - 通常不須要修改,除非有很強的定製慾望…
style:
  # 頭像上面的背景顏色
  header: '#4d4d4d'
  # 右滑板塊背景
  slider: 'linear-gradient(200deg,#a0cfe4,#e8c37e)'

# slider的設置
slider:
  # 是否默認展開tags板塊
  showTags: false

# 智能菜單
# 如不須要,將該對應項置爲false
# 好比
#smart_menu:
#  friends: false
smart_menu:
  innerArchive: '全部文章'
  friends: '友鏈'
  aboutme: '關於我'

friends:
  百度一下: http://www.baidu.com
  友情連接2: http://localhost:4000/
  友情連接3: http://localhost:4000/
  友情連接4: http://localhost:4000/
  友情連接5: http://localhost:4000/
  友情連接6: http://localhost:4000/

aboutme: 小本科一枚<br><br>畢業於沈航,就任於蘇寧<br>只是一個前端小開發

 

四、運行

hexo clean   //清空以前主題

hexo g     //生成靜態文件

hexo s     //在本地運行

hexo d    //發佈到github的page上

 

五、寫新的博客

hexo new '博客文章名字'

 

六、運行測試

hexo s -g   //生成靜態文件,啓動本地服務器

 

能夠查看遠程服務器github.saucxs.io 

相關文章
相關標籤/搜索