This repo contains a python script that can create a blog from a list of markdown files. You just need markdown files, a page template, an index page template, an atom feed template and an atom post template.
If you need some example check my blog source code.
First you will need some compatible written markdown files, the supported markdown is listed below.
After that, you will need to setup the .env file with your configuration and create template for the page, index, Atom Feed & Atom post.
Now that is done, you will need to install the dependencies.
There is two solutions:
You can create a virtual python environment
python -m venv .venv
and install the requirements.txt
.venv/bin/pip install -r requirements.txt
Don't create / use virtual env, just install the requirements on your global python.
pip install -r requirements.txt
Now that everything is configured, you can just run python3 generator.py
and the page will be generated.
Be careful if there is no metadata in your markdown file the page will not be added into the index page.
Here is listed the supported markdown for this blog generator :
#
for title, every line with this will be considered as the title, so only use one.##
,###
,####
for h2, h3, h4.```
for bloc code>
for quote-
for listing (ul > li)
A line which start without this will be considered as a paragraph.
*
for emphasis text**
for strong text![image text](image link)
for image[link text](link)
for link
For creating metadata you need to use ---
before and after the metadata.
Example:
---
date: 31-12-1999
description: new year
tags: new year, happy, test
---
date:
for datedescription:
for descriptiontags:
for tags
This project only has python-dotenv
as dependencies for loading environment variable into python.
If you have any troube you can contact me by email, matrix, or open an issue. If you are a beginner prefer using email, thanks.
- Email: oxbian.noch@simplelogin.com
- Matrix: @oxbian:matrix.org
This project is under the GPLV3 license. You can use, modify, as long as the copy is opensource under the GPLV3 too.
This project was inspired by the blog generator made by Ploum, thanks to him for his work.