配置

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!"
                }
            ]
        }
    }
}

Site & Author & Config

这几项配置起来十分容易。

如果你要用 Google Analytics 的话,记得修改 config.analytics

"config": {
        "source": "posts",
        "output": "deploy",
        "static_prefix": "/static/",
        "analytics": "UA-33275966-1"
},

Comment

Catsup 支持两种评论系统: Disqus多说

如果你更喜欢多说的话,可以轻松的把评论系统设置成多说

"comment": {
    "allow": true,
    "system": "duoshuo",
    "shortname": "catsup"
},

如果你在评论系统中有自己的站点的话,记得把 comment.shortname 改成你自己的

"comment": {
    "allow": true,
    "system": "disqus",
    "shortname": "my_site"
},

如果你不希望开启评论系统,那么就关掉它吧

"comment": {
    "allow": false
},

如果你只是希望部分文章不背评论,可以在 元数据 中设置 - comment: disabled

Deploy & Theme

这几项配置起来十分容易。

如果还不太明白的话,去看看 部署支持 和你主题的文档吧。

Table Of Contents

Related Topics

关于 Catsup

Catsup 是一个以简洁、优雅为目标的轻量级静态站点生成器。

翻译

链接