Catsup 的配置文件是一个标准的 JSON 文件
默认的配置文件看起来是这样的 :
{
"site": {
"name": "blogname",
"description": "Just another catsup blog",
"url": "http://blog.com/"
},
"author": {
"name": "nickname",
"email": "name@exmaple.com",
"twitter": "twitter"
},
"config": {
"source": "posts",
"output": "deploy",
"static_prefix": "/static/",
"analytics": ""
},
"permalink": {
"page": "/page/{page}/",
"post": "/{title}/",
"tag": "/tag/{name}/",
"tags": "/tag/index.html",
"archive": "/archive/{year}/",
"archives": "/archive/index.html",
"feed": "/feed.xml"
},
"comment": {
"allow": true,
"system": "disqus",
"shortname": "catsup"
},
"deploy": {
"default": "rsync",
"git": {
"repo": "repo url here",
"branch": "master",
"delete": true
},
"rsync": {
"ssh_port": 22,
"ssh_user": "username",
"ssh_host": "123.45.6.78",
"document_root": "~/website.com/",
"delete": true
}
},
"theme": {
"name": "sealscript",
"vars": {
"description": "a blog",
"github": "whtsky",
"links": [
{
"name": "catsup",
"url": "https://github.com/whtsky/catsup",
"description": "Awesome!"
}
]
}
}
}
这几项配置起来十分容易。
如果你要用 Google Analytics 的话,记得修改 config.analytics
"config": {
"source": "posts",
"output": "deploy",
"static_prefix": "/static/",
"analytics": "UA-33275966-1"
},
通过修改 config.permalink ,你可以轻松的自定义任何页面的永久链接。
下面这些 Post 页面的永久链接风格比较有参考价值 :
注意,在 文章元数据 中定义的永久链接会被优先使用。
比如说,在配置文件里,你自定义了 Post 页面的永久链接
"permalink": {
"post": "/{title}/",
"feed": "/feed.xml"
},
然后在你的某篇文章中,你在 元数据 中自定义了一个永久链接
# About
- datetime: 2013-08-30 12:00
- type: page
- permalink: /about-the-site
-------
This is a about page
那么,这篇文章的永久链接将会是 /about-the-site .
如果你更喜欢多说的话,可以轻松的把评论系统设置成多说
"comment": {
"allow": true,
"system": "duoshuo",
"shortname": "catsup"
},
如果你在评论系统中有自己的站点的话,记得把 comment.shortname 改成你自己的
"comment": {
"allow": true,
"system": "disqus",
"shortname": "my_site"
},
如果你不希望开启评论系统,那么就关掉它吧
"comment": {
"allow": false
},
如果你只是希望部分文章不背评论,可以在 元数据 中设置 - comment: disabled