Welcome to Hexo ! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub .
Quick Start Create a new post 1 2 3 4 $ hexo new "My New Post" $ hexo new article $ hexo new page tags $ hexo new page tags
More info: Writing
Run server
More info: Server
Generate static files
More info: Generating
Deploy to remote sites
More info: Deployment
总结 安装 1 2 3 4 5 6 7 8 9 10 11 //安装nvm,nvm是一个nodejs的版本管理器 curl https://raw.github.com/creationix/nvm/master/install.sh | sh //安装nodejs 4以上的稳定版,官方有两个版本,目前是4.4.5稳定版本,这里自带的也会安装npm对应的版本 nvm install 4 //如果已经安装,直接安装hexo客户端 npm install -g hexo-cli //有时候上面的安装命令不成功,是因为npm的源请求不到,这里安装一个国内的淘宝源 npm install -g cnpm --registry=https://registry.npm.taobao.org //安装完成之后,cnpm 就可以使用了 cnpm install -g hexo-cli
常用命令 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 hexo new "postName" hexo new page "pageName" hexo new draft "postname" hexo generate hexo server hexo deploy hexo help hexo version hexo publish [layout] postname //git npm install hexo-deployer-git --save hexo deploy -g hexo server -g
Layout
Layout
Path
post
source/_posts
page
source
draft
source/_draft
Scaffolds(脚手架)更改默认的生成模板
是根据scaffolds中的模板来创建的,其中参数可以用下面的:
Placeholder
Description
layout
Layout
title
Title
date
File created date
重新部署 1 2 3 hexo clean hexo generate hexo deploy
部署配置
1 2 3 4 deploy: type : gitrepository: git@github.com:changyuan/changyuan.github.io.git branch: master
在本地生成==ssh-keygen -t rsa -C “admin@example.com “== ,然后把是生成的公钥复制到==Settings->Deploy keys中==
本地调试 1 2 3 4 hexo g hexo s hexo s -g
命令简写 1 2 3 4 hexo n == hexo new hexo g == hexo generate hexo s == hexo server hexo d == hexo deploy
这个静态的web网站就被部署到了github,检查一下分支是gh-pages。gh-pages是github为了web项目特别设置的分支。
Tag Plugins 引用块 Block Quote Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy. 这是引用的话。
Every interaction is both precious and an opportunity to delight.
Seth Godin Welcome to Island Marketing
Code Block
1 [rectangle setX: 10 y: 10 width: 20 height: 20 ];
Array.map 1 array.map(callback[, thisArg])
_.compact <http://underscorejs.org/#compact> Underscore.js 1 _ .compact([0, 1, false, 2, '', 3]); => [1, 2, 3]