a prototype of static site generator
- Node v8.11.3 or later
yarn global add ssg-prototype
or
npm i -g ssg-prototype
├── ssgconfig.json
├── posts/
│ └── YYYY/
│ │ └── MM/
│ │ └── DD/
│ │ └── post-name/
│ │ ├── index.asciidoc
│ │ └── foo.png
└── drafts/
├── draft-name/
│ ├── index.asciidoc
│ └── bar.png
The directories posts/
and drafts/
is created at first time you execute the any command.
The path YYYY/MM/DD
represents the publish date of the post.
About ssgconfig.json
, see Configuration.
ssg-prototype --help
This tool requires package.json.
ssg-prototype new <name>
This command creates the Asciidoc document ./drafts/name/index.asciidoc
.
Edit it and publish them.
ssg-prototype publish <name>
This command moves the directory ./drafts/name/
into ./posts/YYYY/MM/DD/name/
.
ssg-prototype edit <name>
This command copies the directory ./drafts/name/
from ./posts/YYYY/MM/DD/name/
Edit the document and update them.
ssg-prototype update <name>
This command removes the directory ./posts/YYYY/MM/DD/name/
, and moves the directory ./posts/YYYY/MM/DD/name/
from ./drafts/name/
.
ssg-prototype generate
This command creates the posts data JSON ./posts.json
.
= Title
author <email>
:revdate: 2018-07-30T13:02:04+09:00
:revnumber: v1.3.2
:tags: JavaScript,Node,Commaner.js
:summary: This is a summary.
:toc:
The header of Asciidoc is required.
-
title
-
author (optinal email)
-
revnumber
This attribute is required.
-
tags
-
summary
-
toc
Table of contents.
Every command option can be specified in ./ssgconfig.json
.
{
"posts-dir": "src/posts", // default is "./posts"
"drafts-dir": "src/drafts", // default is "./drafts"
"author": "utakuma" // default is "author"
}