Catsup 目前支持三种格式的文章: Markdown, 纯文本 和 HTML.
文章的扩展名应为 .md 或 .markdown .
一个 Hello World 文章应该是这样的
# Hello, World! <---- This is title
- time: 2013-08-25 23:30 <---- This is meta
- tags: hello world
---
Hello, World! <---- This is content
This is my first post in catsup.
I'm writing in **MarkDown** !
<strong>HTML is supported, too</strong>
```python
print("I love python")
```
一篇文章由三部分构成:
标题应该始终在文章的第一行,并且以 # 起头。
分隔符下的一切都是正文,正文应该以 Markdown 形式书写。
有时候你只是想写些东西而不想去考虑文章的格式,那么你应该选择纯文本格式的文章。
纯文本格式的文章的扩展名应该是 .txt 。
最简单的纯文本格式的文章看起来是这样的
Hello!
This is a text post.
如果你想要加一些元数据的话,你应该使用 YAML 格式的元数据
---
title: Hello, World!
tags: Hello, World
time: 2014-01-04 20:56
---
Hello, World! I'm a text post.
HTML 格式的文章就像 纯文本格式的文章, 但是你可以在文章正文中使用 HTML .
HTML 格式的文章的扩展名应该是 .html .
文章样例
---
title: Hello, World!
tags: Hello, World
time: 2014-01-04 20:56
---
<p>I'm writing HTML in catsup</p>
元数据是关于文章的一些信息。 元数据不是必须的,如果你的文章有元数据的话,记得在元数据下面加上 分隔符
独立页面是一种特殊的文章。可以通过在元数据中添加 - type: page 将一篇普通文章转换为元数据。
普通文章和独立页面之间有什么区别呢?