Notes Back
Notes Back


For Ritsu

Static site generator made by TypeScript & Node.js.



$ npm install -g ritsu

Or use from source

$ git clone
$ cd ritsu/dist
$ node index [command]


Ritsu comes with a full set of command-line tool.


Initialize blog.

$ ritsu init [blog-name]
$ ritsu i [blog-name]

This command will initialize a blog directory. If no blog name specified, the directory name will default to new-blog.


Create a new post.

$ ritsu new <post> [template]
$ ritsu n <post> [template]

This command will create a new empty post. If no template is specified, Ritsu will use template named in the templates directory. You can find the created post in drafts directory and start writing!


Publish your post.

$ ritsu publish <post> [date]
$ ritsu p <post> [date]

This command will publish your post. Note that only published posts can be generated. If no date is specified (for the formate of the date see then ritsu will use current time. You can find the published post in posts directory.


Delete your post.

$ ritsu delete <post>
$ ritsu d <post>

This command will delete your published post and move the deleted post to trash directory. If you want to recover the post, please move the post to the drafts directory first, then run ritsu publish again.


Generate blog.

$ ritsu generate [directory-name]
$ ritsu g [directory-name]

This command will build all EJS and style files and generate your blog. If no directory name is specified, the directory name will default to publish.

Note: Use this command only if it's the first time your are generating your site or have made changes to configs and styles. Otherwise ritsu update is faster.


Purge generated blog.

$ ritsu purge <generated-directory>

This command will remove the site generated by ritsu generate.


Update blog.

$ ritsu update [generated-directory]

This command will update the blog with your new posts and keep other componenets (e.g. style) intact, thus faster than ritsu generate.


Deploy blog to GitHub.

$ ritsu deploy [generated-directory]

This command will deploy your blog to GitHub. Remember to specify your GitHub info in site-config.yaml!

Note: If you are encountering problems with node-sass module, modify your npm permission according to instructions here.


There are two configuration files for Ritsu:

  • site-config.yaml
  • theme-config.yaml

For detailed information, see comments written in each file.

加载 Disqus 评论 

*Disqus 在墙内无法访问