Comparing version 0.3.0 to 0.4.0
17
cli.js
@@ -7,5 +7,5 @@ #!/usr/bin/env node | ||
const { mumimal } = require('./src/mumimal'); | ||
const { createPostMd } = require('./src/createPostMd'); | ||
function getConfig() { | ||
const configName = argv.config; | ||
function getConfig(configName) { | ||
if (!configName) { | ||
@@ -21,7 +21,16 @@ return {}; | ||
function mumi() { | ||
const config = getConfig(); | ||
function runMumimal(configName) { | ||
const config = getConfig(configName); | ||
return mumimal(config); | ||
} | ||
function mumi() { | ||
const { config, post } = argv; | ||
if (post) { | ||
return createPostMd(post); | ||
} | ||
return runMumimal(config); | ||
} | ||
mumi().catch((err) => { | ||
@@ -28,0 +37,0 @@ console.error(err); |
{ | ||
"name": "mumimal", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Mumimal is a mumi minimal blog generator.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,5 +20,14 @@ # Mumimal | ||
### Use command | ||
`mumimal` or `mumimal --config config.js` | ||
### CLI | ||
```sh | ||
# create post file | ||
mumimal --post "My new post title" | ||
# build blog | ||
mumimal | ||
# or, build with custom config | ||
mumimal --config config.js | ||
``` | ||
### Use module | ||
@@ -33,3 +42,5 @@ ```js | ||
Your project structure should look like | ||
### Blog Structure | ||
Project structure should look like | ||
``` | ||
@@ -40,4 +51,4 @@ ├── layouts/ | ||
├── posts/ | ||
│ ├── 2020-02-02-your-post-1.md | ||
│ └── 2020-03-24-your-post-2.md | ||
│ ├── 2020-02-02-my-post-1.md | ||
│ └── 2020-03-24-my-post-2.md | ||
├── config.js | ||
@@ -51,2 +62,4 @@ ├── dist/ | ||
See [example project](https://github.com/wabilin/wabilin.github.io). | ||
### Index | ||
@@ -53,0 +66,0 @@ When rendering index, there are: `site` (site config) and |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19325
16
582
152