hexo搭建博客

安裝hexo

  • 第一步裕便、執(zhí)行npm install hexo-cli -g 安裝hexo
  • 第二步铸抑、找到你想寫博客的文件夾奏瞬,執(zhí)行hexo init blog生成文件
  • 第三步班挖、在生成的文件blog中執(zhí)行hexo server鲁捏,訪問http://localhost:4000/

安裝和配置Next主題

  • 在hexo目錄下右鍵Git bash通過命令git clone https://github.com/iissnan/hexo-theme-next themes/next
    next主題自動(dòng)下載到themes目錄下
  • 在blog文件下的站點(diǎn)配置文件_config.yml,找到 theme 字段,并將其值更改為 nexttheme:next
  • hexo s驗(yàn)證主題配置是否成功萧芙,瀏覽器輸入 http://localhost:4000

hexo書寫博客

  • 在source文件夾的_posts里面,通過hexo new 博客標(biāo)題命令生成markdown文件
  • 文章寫好后给梅,執(zhí)行hexo generate命令生成靜態(tài)的html文件

發(fā)送博客到github上

  • 我們把public里面的文件發(fā)布到github上面
  • 在創(chuàng)建github倉庫是取名一定要去[github用戶名].github.io 例子:saber-tgb.github.io
  • 用git發(fā)送到githoub是一定要發(fā)送到master分支
  • 不用更改生成的博客html文件的css,js的路徑 傳上去后路徑就會(huì)正確

next主題的配置和優(yōu)化

# ---------------------------------------------------------------
# Site Information Settings
# ---------------------------------------------------------------

# Place your favicon.ico to /source directory.
favicon: /favicon.ico   #站標(biāo)  可以放在hexo文件夾下的/source里

# Set default keywords (Use a comma to separate)
keywords: "為學(xué),willxue,willxue.top"  #網(wǎng)站關(guān)鍵字

# Set rss to false to disable feed link.
# Leave rss as empty to use site's feed link.
# Set rss to specific value if you have burned your feed already.
rss:  #rss這里不設(shè)置 引文站點(diǎn)配置文件已經(jīng)配置了 需要安裝插件

# Specify the date when the site was setup
since: 1990  #網(wǎng)站時(shí)間 從xx開始 類似 1990-2016


# ---------------------------------------------------------------
# Menu Settings
# ---------------------------------------------------------------

# When running hexo in a subdirectory (e.g. domain.tld/blog)
# Remove leading slashes ( "/archives" -> "archives" )
menu: #菜單路徑設(shè)置 如果hexo在二級(jí)目錄放置要去掉/
  home: /
  archives: /archives #歸檔
  tags: /tags #標(biāo)簽
  categories: /categories  #分類
  about: /about #關(guān)于我
  commonweal: /404.html  #公益404


# Enable/Disable menu icons.
# Icon Mapping:
#   Map a menu item to a specific FontAwesome icon name.
#   Key is the name of menu item and value is the name of FontAwsome icon.
#   When an question mask icon presenting up means that the item has no mapping icon.
menu_icons:  #icon圖標(biāo)
  enable: true
  # Icon Mapping.
  home: home
  about: user
  categories: th
  tags: tags
  archives: archive
  commonweal: heartbeat




# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------

# Schemes  #next的三個(gè)scheme
#scheme: Muse
#scheme: Mist
scheme: Pisces



# ---------------------------------------------------------------
# Sidebar Settings
# ---------------------------------------------------------------


# Social links   #社交鏈接
social:
  GitHub:
  Weibo:
  Others:

# Social Icons  #社交的圖標(biāo)
social_icons:
  enable: true
  # Icon Mappings
  GitHub: github
  Twitter: twitter
  Weibo: weibo


# Sidebar Avatar
# in theme directory(source/images): /images/avatar.jpg
# in site  directory(source/uploads): /uploads/avatar.jpg
# default : /images/default_avatar.jpg
avatar: http://7xrz9n.com1.z0.glb.clouddn.com/logo.png #頭像


# TOC in the Sidebar  #文章自動(dòng)顯示目錄
toc:
  enable: true

  # Automatically add list number to toc.  #目錄是否自動(dòng)顯示數(shù)字序號(hào)
  number: false


# Creative Commons 4.0 International License.
# http://creativecommons.org/  #自由協(xié)議
# Available: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero
#creative_commons: by-nc-sa
#creative_commons:

sidebar:
  # Sidebar Position, available value: left | right
  position: left
  #position: right

  # Sidebar Display, available value:
  #  - post    expand on posts automatically. Default.
  #  - always  expand for all pages automatically
  #  - hide    expand only when click on the sidebar toggle icon.
  #  - remove  Totally remove sidebar including sidebar toggle icon.
  display: post
  #display: always
  #display: hide
  #display: remove



# ---------------------------------------------------------------
# Misc Theme Settings
# ---------------------------------------------------------------

# Custom Logo.
# !!Only available for Default Scheme currently.
# Options:
#   enabled: [true/false] - Replace with specific image
#   image: url-of-image   - Images's url
custom_logo:
  enabled: false
  image:


# Code Highlight theme
# Available value:
#    normal | night | night eighties | night blue | night bright
# https://github.com/chriskempson/tomorrow-theme
highlight_theme: night

# Automatically scroll page to section which is under <!-- more --> mark.
scroll_to_more: true

# Automatically Excerpt
auto_excerpt:
  enable: false
  length: 150

# Use Lato font
use_font_lato: true



# ---------------------------------------------------------------
# Third Party Services Settings
# ---------------------------------------------------------------

# MathJax Support
mathjax:


# Swiftype Search API Key
#swiftype_key:

# Baidu Analytics ID
#baidu_analytics:

# Duoshuo ShortName
duoshuo_shortname: imwillxue

# Disqus
#disqus_shortname:

# Baidu Share
# Available value:
#    button | slide
#baidushare:
##  type: button

# Share
#jiathis:
#add_this_id:

# Share
duoshuo_share: true

# Google Webmaster tools verification setting
# See: https://www.google.com/webmasters/
#google_site_verification:


# Google Analytics
#google_analytics:

# CNZZ count
#cnzz_siteid:


# Make duoshuo show UA
# user_id must NOT be null when admin_enable is true!
# you can visit http://dev.duoshuo.com get duoshuo user id.
duoshuo_info:
  ua_enable: true
  admin_enable: true
  user_id: 6262178932196377345
  admin_nickname: 神


# Facebook SDK Support.
# https://github.com/iissnan/hexo-theme-next/pull/410
facebook_sdk:
  enable: false
  app_id:       #<app_id>
  fb_admin:     #<user_id>
  like_button:  #true
  webmaster:    #true


# Show number of visitors to each article.
# You can visit https://leancloud.cn get AppID and AppKey.
leancloud_visitors:
  enable: true
  app_id: QImiFijLSOHYufsazlBVlwLg-gzGzoHsz
  app_key: AMcYaNHy9Y5OdH42k0d4uSED


# Tencent analytics ID
# tencent_analytics:

# Enable baidu push so that the blog will push the url to baidu automatically which is very helpful for SEO
baidu_push: true

## 文章末尾是否顯示打賞按鈕
donate:
  enable: true
  text: Enjoy it ? Donate me !  欣賞此文双揪?求鼓勵(lì)动羽,求支持!
  alipay:
  wechat:


#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! ---------------------------------------------------------------

# Motion
use_motion: true

# Fancybox
fancybox: true

# Static files
vendors: vendors
css: css
js: js
images: images

# Theme version
version: 0.5.0
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末渔期,一起剝皮案震驚了整個(gè)濱河市运吓,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌疯趟,老刑警劉巖拘哨,帶你破解...
    沈念sama閱讀 222,627評(píng)論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異信峻,居然都是意外死亡倦青,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,180評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門盹舞,熙熙樓的掌柜王于貴愁眉苦臉地迎上來产镐,“玉大人,你說我怎么就攤上這事踢步⊙⒀牵” “怎么了?”我有些...
    開封第一講書人閱讀 169,346評(píng)論 0 362
  • 文/不壞的土叔 我叫張陵贾虽,是天一觀的道長逃糟。 經(jīng)常有香客問我,道長蓬豁,這世上最難降的妖魔是什么绰咽? 我笑而不...
    開封第一講書人閱讀 60,097評(píng)論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮地粪,結(jié)果婚禮上取募,老公的妹妹穿的比我還像新娘。我一直安慰自己蟆技,他們只是感情好玩敏,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,100評(píng)論 6 398
  • 文/花漫 我一把揭開白布斗忌。 她就那樣靜靜地躺著,像睡著了一般旺聚。 火紅的嫁衣襯著肌膚如雪织阳。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 52,696評(píng)論 1 312
  • 那天砰粹,我揣著相機(jī)與錄音唧躲,去河邊找鬼。 笑死碱璃,一個(gè)胖子當(dāng)著我的面吹牛弄痹,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播嵌器,決...
    沈念sama閱讀 41,165評(píng)論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼肛真,長吁一口氣:“原來是場噩夢(mèng)啊……” “哼!你這毒婦竟也來了爽航?” 一聲冷哼從身側(cè)響起蚓让,我...
    開封第一講書人閱讀 40,108評(píng)論 0 277
  • 序言:老撾萬榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎讥珍,沒想到半個(gè)月后凭疮,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,646評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡串述,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,709評(píng)論 3 342
  • 正文 我和宋清朗相戀三年执解,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片纲酗。...
    茶點(diǎn)故事閱讀 40,861評(píng)論 1 353
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡衰腌,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出觅赊,到底是詐尸還是另有隱情右蕊,我是刑警寧澤,帶...
    沈念sama閱讀 36,527評(píng)論 5 351
  • 正文 年R本政府宣布吮螺,位于F島的核電站饶囚,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏鸠补。R本人自食惡果不足惜萝风,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,196評(píng)論 3 336
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望紫岩。 院中可真熱鬧规惰,春花似錦、人聲如沸泉蝌。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,698評(píng)論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至贪磺,卻和暖如春硫兰,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背寒锚。 一陣腳步聲響...
    開封第一講書人閱讀 33,804評(píng)論 1 274
  • 我被黑心中介騙來泰國打工瞄崇, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人壕曼。 一個(gè)月前我還...
    沈念sama閱讀 49,287評(píng)論 3 379
  • 正文 我出身青樓,卻偏偏與公主長得像等浊,于是被迫代替她去往敵國和親腮郊。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,860評(píng)論 2 361

推薦閱讀更多精彩內(nèi)容