Stefan4472 / Stefans-Blog

Personal blogging platform built in Python
MIT License
0 stars 0 forks source link

Stefans-Blog

A blogging website written in Python 3.9 using the flask framework. Licensed under the MIT License. See it live at www.stefanonsoftware.com.

Features

Along with this site, I'm also working on two sibling projects:

This repository contains code and templates, but no blog articles. My long-term goal is to make it 100% configurable and extensible, so that anyone could use it to build their own blog.

Project Organization

Posts

The website does not (yet) have a graphical interface for writing posts. Therefore, posts are created on your local computer and uploaded to the website via the scripts in stefan-on-software-api-client/bin. Each post should have a separate directory that includes:

  1. The Markdown content of the post in a file called post.md
  2. The post configuration/metadata (e.g. Title, Byline, Tags) in a file called post-meta.json

See the provided example post (in the example-post directory) for more information.

Setup

Upgrade pip (recommended) and install the required packages:

python -m pip install --upgrade pip
pip install -r requirements.txt

See the package-specific READMEs for more information.

Linting

Code should be linted using black and isort. Furthermore, before pushing, you should run pyflakes and ensure that there are no errors.

black . && isort . && pyflakes .

Generating the API client

This project uses openapi-python-client to automatically generate a Python client library based on the website's OpenAPI definition. To generate or update the client library, install openapi-python-client in a separate virtual environment. Then, from the root directory of this project, run openapi-python-client update --path api.yaml.