Ritsu
For Ritsu
Static site generator made by TypeScript & Node.js.
Installation
$ npm install -g ritsu
Or use from source
$ git clone https://github.com/H2O-2/ritsu.git
$ cd ritsu/dist
$ node index [command]
Usage
Ritsu comes with a full set of command-line tool.
init
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
.
new
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 default.md in the templates
directory. You can find the created post in drafts
directory and start writing!
publish
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 https://momentjs.com/docs/#/displaying/) then ritsu will use current time. You can find the published post in posts
directory.
delete
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
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
Purge generated blog.
$ ritsu purge <generated-directory>
This command will remove the site generated by ritsu generate
.
update
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
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.
Configurations
There are two configuration files for Ritsu:
- site-config.yaml
- theme-config.yaml
For detailed information, see comments written in each file.
加载 Disqus 评论
*Disqus 在墙内无法访问