Blog
This is a static site generator, that uses markdown files as input and outputs web pages.
How to use ?
Set up (One time only)
- Download NodeJS.
- Create a new project (folder)
- Create a valid package.json file with
npm init
for example - Run the command
npm i blog-engine-sac --ignore-scripts
- add script
"sac": "node node_modules/blog-engine-sac/source/main.js"
inside package.json - follow instructions below to create required files
npm run sac
- to view the results use a static file server
Create a new post
Create a new markdown file in the folder source/
. A markdown file is a normal text file with .md
file extension. The name of the file is used as the name of the post. Then rebuild.
site settings
Create file blog-engine-sac.json
with
{
"mainTitle": "BLOG",
"subTitle": "FOOD AND FUN",
"defaultLang": "en",
"defaultAuthor": "AUTHOR NAME",
"defaultLicense": "LICENSE",
"categories": [{
"tag": "categorieA",
"name": "categorieA"
},{
"tag": "categorieB",
"name": "categorieB"
}]
}
Ideally defaultLicense is a spdix shorthand, default lang an internation 2 letter shorthand.
Change the values as you see fit.
categories
categories are provided by the user as an array for the entire blog
for example: travel, cuisine, sports
Each category will have a dedicated index page that acts like the main index page but only lists post of that category. Posts will be in that category if they have a corresponding tag.
about page
Create file source/extras/about.md
.
contact page
Create file source/extras/contact.md
.
Create file source/extras/footer.md
.
Edit Images
Open folder images
Replace the images with new ones but keep the exact filename to not break the links. (Images are linked from other files, not copied, the name of the files are used)
Required images
images/about.jpg
images/contact.jpg
images/home.jpg
images/post.jpg
user provided tags
found in the meta file as an array
auto generated tags (disabled)
are gathered from the plain text of each post based on heuristacs (rarity and uniqueness)
tags
tags is a set that combines user provided tags and auto generated tags and title. It is used for search function. They are also displayed after the post.
What is mark down
A text format. Learn it here https://commonmark.org/help/
About the code
Don't remove, edit or add any other file unless you know exactly what you are doing!
HTML files
are generated. Do not edit directly
About
Design starting point
Start Bootstrap - Clean Blog
is a stylish, responsive blog theme for Bootstrap created by Start Bootstrap. This theme features a blog homepage, about page, contact page, and an example post page along with a working PHP contact form.
Copyright and License
CC0 (Only for blog-engine-sac itself)