Hexo是一個快速、簡潔且高效的博客框架,使用Markdown(或其餘渲染引擎)解析文章,在幾秒內,便可利用靚麗的主題生成靜態網頁。目前比較火的vue和weex的文檔都是使用hexo框架實現的。css
安裝hexo前,確保電腦中已經安裝了node和git。html
方法1、 直接安裝node:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 方法2、 先安裝homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 後安裝node:brew install node
先安裝homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 後安裝git:brew install git
npm install -g hexo-cli
新建項目: hexo init folder
vue
進入: cd folder>
node
安裝依賴包: npm install
git
新建一篇文章: hexo new iOS-APIs
(文件會在/source/_posts下)github
啓動: hexo server
npm
瀏覽器打開: http://localhost:4000/document/
瀏覽器
配置文件爲_config.yml
參考: https://hexo.io/docs/configur...
github: https://github.com/hexojs/hexo/ruby
網站標題
title: weex使用手冊weex
網站副標題
subtitle: weex中文手冊
網站描述
description: 整理weex手冊, 包括通用特性, 內建組件, 內建模塊, CSS 單位, 通用事件, Native DOM APIs, Weex 實例變量, Web 標準, JS Service, Vue, 高階知識, 遷移
做者名字
author: lu.wei
網站使用的語言
language: 簡體中文
網站時區Hexo 默認使用您電腦的時區。時區列表。好比說:America/New_York, Japan, 和 UTC 。
timezone: UTC
若是您的網站存放在子目錄中,例如 http://yoursite.com/blog,則請將您的 url 設爲 http://yoursite.com/blog 並把 root 設爲 /blog/。
網站根目錄
root: /document/
文章的 永久連接 格式
permalink: :year/:month/:day/:title/
永久連接中各部分的默認值
permalink_defaults:
資源文件夾,這個文件夾用來存放內容。
source_dir: source
公共文件夾,這個文件夾用於存放生成的站點文件。
public_dir: public
標籤文件夾
tag_dir: tags
歸檔文件夾
archive_dir: archives
分類文件夾
category_dir: categories
Include code 文件夾
code_dir: downloads/code
國際化(i18n)文件夾
i18n_dir: :lang
跳過指定文件的渲染,您可以使用 glob 表達式來匹配路徑。
skip_render:
新建文章的文件名稱
new_post_name: :title.md
預設佈局
default_layout: post
在中文和英文之間加入空格
auto_spacing: false
把標題轉換爲 title case
titlecase: false
在新標籤中打開連接
external_link: true
把文件名稱轉換爲 (1) 小寫或 (2) 大寫
filename_case: 0
顯示草稿
render_drafts: false
啓動 Asset 文件夾
post_asset_folder: true
把連接改成與根目錄的相對位址
relative_link: false
顯示將來的文章
future: true
代碼塊的設置
highlight: enable: true line_number: true auto_detect: true tab_replace:
1. path: 博客索引頁的跟路徑,默認爲空 2. per_page: 每頁展現的文章量, 爲0時表示不分頁 3. order_by: 排序, 默認日期降序 index_generator: path: '' per_page: 10 order_by: -date
默認分類
default_category: uncategorized
分類別名
category_map:
標籤別名
tag_map:
hexo使用Moment.js來解析和顯示時間。
能夠參照http://momentjs.com/docs/#/di...來自定義日期格式。
日期格式
date_format: YYYY-MM-DD
時間格式
time_format: HH:mm:ss
每頁顯示的文章量 (0 = 關閉分頁功能)
per_page: 10
分頁目錄
pagination_dir: page
插件: https://hexo.io/plugins/
主題: https://hexo.io/themes/
當前主題名稱。值爲false時禁用主題
theme: landscape
參考: https://hexo.io/docs/deployme...
部署部分的配置
deploy: type: git repo: https://github.com/stardew516/document branch: master message: hexo + css
github上部署:
安裝hexo-deployer-git: npm install hexo-deployer-git --save
_config.yml 中配置
# 部署部分的設置 deploy: type: git repo: https://github.com/stardew516/document branch: master message: hexo + css
終端進入目錄,運行: hexo deploy