折腾许久的博客工具,反而没有实际写多少内容。遂决定“尽量”不折腾了,而是专心写些东西。最终用 Hexo 搭的博客,选 Maupassant 作主题,几乎没有额外的配置,准备就此开工。第一篇文章就用作测试 Hexo 的 Markdown 语法吧。
本博的一些设置
只有一点值得一提,代码习惯,不太喜欢一行写太长。习惯上一行保留 80/100/120 字符。只是这个习惯在写文章时会引起一些问题:
- Markdown 解析连续行时会添加额外空格,使中文文章中多出额外空格。
- Maupassant 主题自动截取摘要时只认第一个换行
以下是解决方法:
-
修改 Maupassant 主题的
layout/index.jade
文件,替换原有行:- var br = post.content.indexOf('\n') // 替换为
- var br = post.content.indexOf('</p>')
!= post.content.substring(0, br) // 替换为
!= post.content.substring(0, br + 4)
Markdown 测试主要参照 这篇文章
标题
# 大标题 |
行内元素
* 或 - 均可,一个表斜体,两个表粗体 |
斜体 斜体 粗体 粗体
引用
> blockquote |
blockquote
nested blockquote
列表
- Unordered Level 1 |
- Unordered Level 1
- Unordered Level 2
- ordered 1
- sub list 1
- sub list 2
- ordered 2
- ordered 3
- ordered 1
- Unordered Level 3
- sub unordered 1
- sub unordered 2
-
subsub unordered 1
-
subsub unordered 2 continue line
multiple paragraph of unordered 2 with the same indent
-
分割线
--- |
链接
链接中的 URL 可以是本地路径。
文字链接:[文字](url) 或 [文字](url tooltip) |
图片链接: |
代码
var http = require('http'); |
Code Block:
{% codeblock Javascript Array Syntax lang:js http://j.mp/pPUUmW MDN Documentation %} |
var arr1 = new Array(arrayLength); |
Gist Tag
{% gist 996818 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -590,7 +590,7 @@ class SpritesTest < Test::Unit::TestCase | |
it "should generate a sprite from nested folders" do | |
css = render <<-SCSS | |
- @import "nested/*.png"; | |
+ @import "nested/**/*.png"; | |
@include all-nested-sprites; | |
SCSS | |
assert_correct css, <<-CSS |
jsFiddle:
{% jsfiddle ccWP7 %} |
公式
该主题暂不支持
$$E=mc^2$$ |
$$E=mc^2$$
The Gamma function satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral $$\Gamma(z) = \int_0^\infty t{z-1}e{-t}dt,.$$