🌐 ⚙️ A python script that can create a blog from a list of markdown files.
Go to file
Oxbian 572b4ef237 Actualiser README.md 2023-10-23 21:27:34 +02:00
.env Updating .env 2023-07-06 00:36:10 +02:00
.gitignore Updating .gitignore & removing print from generator.py 2023-06-25 00:23:46 +02:00
LICENSE Init commit 2023-06-24 21:40:36 +02:00
README.md Actualiser README.md 2023-10-23 21:27:34 +02:00
generator.py Fix duplicate page 2023-07-06 09:22:11 +02:00
markdown_parser.py Adding language system 2023-07-06 00:33:35 +02:00
requirements.txt Init commit 2023-06-24 21:40:36 +02:00

README.md

Blog Generator

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.

How to setup

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:

First solution virtual env

You can create a virtual python environment

python -m venv .venv

and install the requirements.txt

.venv/bin/pip install -r requirements.txt

Second solution install on your global python

Don't create / use virtual env, just install the requirements on your global python.

pip install -r requirements.txt

How to use it

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.

Supported markdown

Here is listed the supported markdown for this blog generator :

Line type

  • # 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.

Line content

  • * for emphasis text
  • ** for strong text
  • ![image text](image link) for image
  • [link text](link) for link

Metadata

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 date
  • description: for description
  • tags: for tags

Dependencies

This project only has python-dotenv as dependencies for loading environment variable into python.

Trouble & help

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.

License

This project is under the GPLV3 license. You can use, modify, as long as the copy is opensource under the GPLV3 too.

Credits

This project was inspired by the blog generator made by Ploum, thanks to him for his work.