This section needs you have Catsup installed.If you don’t, please go and Install it
It’s pretty simple to create a site using Catsup
$ mkdir site
$ cd site
$ catsup init
Let’s see what happened
$ ls
config.json posts
After running catsup init, Catsup generates a sample config file config.json and an empty post folder posts.
Now, let’s configure your new site.
Catsup can be highly customized, but you only need to change a few variables to get started :
Want to learn more about configuration file? Take a look at Configuration
After configuring your site, it’s time to start writing.
Let’s write a post first
vim posts/hello-world.md
a Hello World post looks like
# Hello, World!
- time: 2013-08-25 23:30
- tags: hello world
---
Hello, World!
This is my first post in catsup.
I'm writing in **MarkDown** !
<strong>HTML is supported, too</strong>
```python
print("I love python")
```
Then, let’s write a page to talk about your site
vim posts/about.md
a About page looks like
# About the site
- time: 2013-08-25 23:31
- type: page
----
Hi!
This site is generated by [catsup](https://github.com/whtsky/catsup).
Read about Post Syntax to learn more.
After writing posts and pages, It’s time to build your site and let everyone know!
But don’t hurry, let’s take a look at your site first
catsup server
Then open your favorite web browser, go to http://127.0.0.1:8888 .
Head over to Preview Server to know more.
After making sure everything’s all right, let’s build the site
catsup build
Let’s see what happened
$ ls
config.json deploy posts
Thanks to GitHub, we have a perfect place to host our site.
You need to have a repo called YOUR_GITHUB_USERNAME.github.io. If you don’t, go to create one
Then edit your configuration file, change deploy section like this
"deploy": {
"default": "git",
"git": {
"repo": "git@github.com:YOUR_GITHUB_USERNAME/YOUR_GITHUB_USERNAME.github.io.git",
"branch": "master",
"delete": true
}
},
replace YOUR_GITHUB_USERNAME with your github username, like whtsky .
After that, let’s deploy your site to GitHub Pages
catsup build && catsup deploy
Then open http://YOUR_GITHUB_USERNAME.github.io to enjoy your fresh site.
Catsup also supports deploy via rsync. Before continue, make sure you have rsync running on your server.
Then edit your configuration file, change deploy section like this
"deploy": {
"default": "rsync",
"rsync": {
"ssh_port": 22,
"ssh_user": "USER_NAME_HERE",
"ssh_host": "IP_ADDRESS_OF_YOUR_SERVER",
"document_root": "DEPLOY_TO_WHICH_PATH",
}
},
Here’s an example
"deploy": {
"default": "rsync",
"rsync": {
"ssh_port": 22,
"ssh_user": "whtsky",
"ssh_host": "whouz.com",
"document_root": "~/whouz.com",
}
},
After that, let’s deploy your site via rsync
catsup build && catsup deploy
Head over to Deploy Support to know more.