0.1.6 • Published 5 years ago
simpleblogmaker v0.1.6
What is this?
A quick static web blog creator, for quickly pulling together a vanilla 1990s blog. A bit of a hack. Not ready for use.
Create a folder for your blog and install
mkdir blog && cd blog
npm init
npm install static-blog-builder --saveCreate homepage:
touch index.htmladd the following:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="Description" content="">
<title>Posts</title>
</head>
<body>
<h1>Posts</h1>
<ul>
{{#each this}}
<li><a href="{{link}}/index.html">{{title}}</a></li>
{{/each}}
</ul>
</body>
</html>add a blog template
touch blogtemplate.htmlAdd the following code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{title}}</title>
<meta name="Description" content="Post about {{title}}">
</head>
<body>
<a href="../index.html">Back to contents</a>
<h1>{{title}}</h1>
{{{body}}}
</body>
</html>Create a folder called posts
mkdir posts
cd postsAdd a new folder for each post
mkdir helloworld
cd helloworldInside each folder, create a file called post.md and add your post in the following format:
---
title: Hello World
description: A description of the post
date: 2020-06-15
status: published
---
Your content in markdown here...
- Apple
- Orange
- FruitEach folder contains a post.
Add build script to package.json
"scripts": {
"build": "build"
}To generate site run
npm run build