Mumimal
Mumi and minimal blog engine.
Thin, fast and extendable.
Install
yarn add mumimal
npm install mumimal
Usage
CLI
mumimal --post "My new post title"
mumimal
mumimal --config config.js
Use module
const { mumimal } = require('mumimal');
const config = {
}
mumimal(config).then(...)
Blog Structure
Project structure should look like
├── layouts/
│ ├── index.ejs
│ └── post.ejs
├── posts/
│ ├── 2020-02-02-my-post-1.md
│ └── 2020-03-24-my-post-2.md
├── config.js
├── dist/
└── static/
- All files inside
static
would be copy to dist
. - Mumimal builds: index, posts, rss and sitemap.
See example project.
Index
When rendering index, there are: site
(site config) and
site
: site configposts
: meta data of each posts
For example, you can use them like
<% posts.forEach(post => { %>
<header>
<h3>
<%= post.dateStr %>
</h3>
<h2>
<a href="<%= post.link %>">
<%= post.title %>
</a>
</h2>
</header>
<% }) %>
To read post content when building index:
<% const { content } = funcs.readPostSrc(post.postName) %>
Post
When rendering index, there are:
site
: site configmeta
: meta data of this postcontent
: html converted from markdown
For example, you can use them like
<% posts.forEach(post => { %>
<head>
<title>Site Name | <%= meta.title %></title>
</head>
<body>
<div class="tags"><%= meta.tags.join(', ') %></dib>
<article>
<%- content %>
</article>
</body>
And post markdown should in this format
---
title: My Post Title
tags: tag1 tag2
---
Text content in [markdown](/markdown.html)
Configuration
Use mumimal --config config.js
to apply custom config.
const config = {
site: {
url: 'https://github.com/yourName/',
title: 'My Cool Blog'
},
feed: {
title: 'My Cool Blog',
description: 'This is an apple',
image: `https://somewhere.example.com/logo.png`,
categories: ["Tech", "Node.js"]
},
build: {
minify: true,
minifyOptions: {},
}
afterBuild: (context) => {
console.log(context)
}
}
module.exports = { config }
What is Mumi
Also known as "姆咪" (Chinese) and "ムミ" (Japanese), .
A characters of Battle Girl High School (バトガ).
Her name is Michelle Watagi (綿木 ミシェル).
But in Taiwan, we all call her Mumi.