文章出處

開始更換主題,hexo默認的主題是landscape,可以更換為其他的主題yilia主題

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

詳細的可以查看hexo博客的演示:https://saucxs.github.io/

可以查看在github上生成的靜態文件:https://github.com/saucxs/saucxs.github.io.git,如果覺得可以請給顆星星。

 

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

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。

 

1、clone主題代碼

在根目錄下執行

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

 

2、修改配置文件

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

theme: yilia    //默認為landscape

 

3、修改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

#評論:1、多說;2、網易云跟帖;3、暢言;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>只是一個前端小開發

 

4、運行

hexo clean   //清空之前主題

hexo g     //生成靜態文件

hexo s     //在本地運行

hexo d    //發布到github的page上

 

5、寫新的博客

hexo new '博客文章名字'

 

6、運行測試

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

 

可以查看遠程服務器github.saucxs.io 

 


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜

    大師兄 發表在 痞客邦 留言(0) 人氣()