Hexo介绍

hexo_logo

Welcome to Hexo! This is your very first post. Check documentatoin 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.

hexo 一些相关的命令

这里会介绍一些hexo相关的命令

一些博客链接

搭建博客连接:http://ibruce.info/2013/11/22/hexo-your-blog/

Create a new post

新建一篇文章

1
$ hexo new "My New Post"

More info: Writing

Run server

本地服务器启动,可以在本地看到博客的情况,方便测试

1
$ hexo server

More info: Server

Generate static files

生成hexo静态文件

1
$ hexo generate

More info: Server

Clean public folder files

清除public文件夹下的已经生成的静态文件

1
$ hexo clean

Deploy to remote sites

部署到github上的master分支上去

1
$ hexo deploy

More info: Deployment

Hexo 的一些独特的标签 tag

blank-tags

Now, We’ll talk a little bit hexo tag plugins, To help you munipulate you blog easily!

居中引言 centerquote

{% centerquote %} 引言放这里 {% endcenterquote %}

引言放这里

左对齐引言 blockquote

{% blockquote David Levithan, Wide Awake http://wanders.com.cn 万的个人网站 %} 摘要引言放这里 {% endblockquote %}

引言:

Do not just seek happiness for yourself. Seek happiness for all. Through kindness. Through mercy.

插入图片

  • ![/images/blank-tags.png](/images/blank-tags.png) 这个是标准的markdown的插入图片的语法
  • {% asset_img water-flow.jpg water is comming ! %} 这种标签标示的时候water-flow.jpg必须要在文章同级目录下的同名文件夹下
    图片:
    /images/blank-tags.jpg

插入视频 add a youtubu video

{% youtube wgdBVIX9ifA %}

这里是视频id=wgdBVIX9ifA:

嵌入一段代码,代码是根路径下的文件:gulpfile.js

{% include_code [gulpfile] [lang:javascript] gulpfile.js %}
[gulpfile] []view raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var htmlmin = require('gulp-htmlmin');
var htmlclean = require('gulp-htmlclean');

// 压缩 public 目录 css
gulp.task('minify-css', function() {
return gulp.src('./public/**/*.css')
.pipe(minifycss())
.pipe(gulp.dest('./public'));
});
// 压缩 public 目录 html
gulp.task('minify-html', function() {
return gulp.src('./public/**/*.html')
.pipe(htmlclean())
.pipe(htmlmin({
removeComments: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
}))
.pipe(gulp.dest('./public'))
});
// 压缩 public/js 目录 js
gulp.task('minify-js', function() {
return gulp.src('./public/**/*.js')
.pipe(uglify())
.pipe(gulp.dest('./public'));
});
// 执行 gulp 命令时执行的任务
gulp.task('default', [
'minify-html','minify-css','minify-js'
]);

给代码片段加入一个URL codeblock

{% codeblock _.compact http://underscorejs.org/#compact Underscore.js %} code put here {% endcodeblock %}
_.compactUnderscore.js
1
2
_.compact([0, 1, false, 2, '', 3]);
=> [1, 2, 3]

普通段落引言

{% pullquote [qut] %}{% endpullquote %}

you wanna quote something, you’d better place it here!

嵌入一个网页 add a iframe

{% iframe http://www.bing.com 100% 100% %}

页面:

原始文字 raw

{% raw %} what ever you put here {% endraw %} If certain content is causing processing issues in your posts, wrap it with the raw tag to avoid rendering errors.

邮件 mail to me

kriswansf@gmail.com
鼓励一下


热评文章