hexo + github 博客搭建

操作命令

  sudo npm install -g hexo
  hexo init
  hexo server

  hexo clean
  hexo generate
  hexo deploy

關聯github

  vim _config.yml
  deploy:

 type: git

 repo: https://github.com/misszero8090/misszero8090.github.io.git

 branch: master

然后執行命令:

  npm install hexo-deployer-git --save

一些常用命令:

hexo new"postName" #新建文章

hexo new page"pageName" #新建頁面

hexo generate #生成靜態頁面至public目錄

hexo server #開啟預覽訪問端口(默認端口4000,'ctrl + c'關閉server)

hexo deploy #將.deploy目錄部署到GitHub

hexo help # 查看幫助

hexo version #查看Hexo的版本

Site #站點信息

title: blog Name #標題
subtitle: Subtitle #副標題
description: my blog desc #描述
author: me #作者
language: zh-CN #語言
timezone: Asia/Shanghai #時區

# URL
url: http://yoururl.com   #用于綁定域名, 其他的不需要配置
root: /
#permalink: :year/:month/:day/:title/
permalink: posts/title.html
permalink_defaults:

Directory #目錄

source_dir: source #源文件
public_dir: public #生成的網頁文件
tag_dir: tags #標簽
archive_dir: archives #歸檔
category_dir: categories #分類
code_dir: downloads/code
i18n_dir: :lang #國際化
skip_render:

Writing #寫作

new_post_name: :title.md #新文章標題
default_layout: post #默認模板(post page photo draft)
titlecase: false #標題轉換成大寫
external_link: true #新標簽頁里打開連接
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight: #語法高亮
enable: true
line_number: true #顯示行號
auto_detect: true
tab_replace:

Category & Tag #分類和標簽

default_category: uncategorized #默認分類
category_map:
tag_map:

Date / Time format #日期時間格式

## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

Pagination #分頁

per_page: 10 #每頁文章數, 設置成 0 禁用分頁
pagination_dir: page

Extensions #插件和主題

## 插件: http://hexo.io/plugins/
## 主題: http://hexo.io/themes/
theme: next

Deployment #部署, 同時發布在 GitHub 和 GitCafe 上面

deploy:
- type: git
  repo: git@gitcafe.com:username/username.git,gitcafe-pages
- type: git
  repo: git@github.com:username/username.github.io.git,master

Disqus #Disqus評論系統

disqus_shortname: 

plugins: #插件,例如生成 RSS 和站點地圖的

- hexo-generator-feed
- hexo-generator-sitemap
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容