A minimal app framework for content sites π΅
π Complete documentation at https://coltrane.readthedocs.io.
π¦ Package located at https://pypi.org/project/coltrane/.
β Features
- Render
markdownfiles as HTML with automatic URL routing based on the filesystem - Use JSON files as data sources in HTML templates or
markdown - Automatic generation of
sitemap.xmlandrss.xmlfiles - Can serve non-markdown files like
robots.txt - Local development server which includes live re-rendering of markdown and data via https://github.com/adamchainz/django-browser-reload
- Site-wide redirects
- Deployment best practices with
whitenoiseandgunicornalready configured - Leverage the power of built-in
Djangotemplates, template tags, and filters insidemarkdownfiles - Any custom template tags and filters are enabled automatically for use in
markdownor HTML templates - Include any third-party
Djangoapp for additional functionality - Serve multiple domains with custom sites
- Optional command to generate static HTML files
- Can be integrated into a regular
Djangoproject as a standard third-partyDjangoapp to render markdown content
β‘ Quick start
mkdir new-site && cd new-siteto create a new folderpython3 -m venv .venv && source .venv/bin/activate && pip install coltraneto install thecoltranepackagecoltrane createto create the folder structure for a new sitecoltrane playto start local development server- Go to http://localhost:8000 to see the original markdown rendered into HTML
- Update
content/index.md - Refresh http://localhost:8000 to see the updated markdown rendered into HTML
- Optional: run
coltrane recordto build static HTML files
Generated coltrane file structure
.
βββ .gitignore
βββ Dockerfile
βββ README.md
βββ pyproject.toml
βββ site
βββ .env
βββ .watchmanconfig
βββ __init__.py
βββ app.py
βββ content
βΒ Β βββ index.md
βββ data
βββ gunicorn.conf.py
βββ static
βββ templates
π Content
Add markdown files or sub-directories to the content directory and rendered HTML will be accessible via auto-generated routes.
/would render themarkdownincontent/index.md/about/would render themarkdownincontent/about.md/articles/this-is-the-first-article/would render the content from/content/articles/this-is-the-first-article.md/not-there/will 404
HTML will also be served automatically if a markdown file can not be found.
/app/would render the HTML from/templates/app.htmlor/templates/app/index.html/app/some-userwould render the HTML from/templates/app/*.html
Deployment
Example Dockerfile and gunicorn.conf.py files are created when an app is created, and optional dependencies can be installed for efficient static serving with whitenoise.
π Documentation
Read all of the documentation at https://coltrane.readthedocs.io.
Contributors β¨
Thanks goes to these wonderful people (emoji key):
Tobi DEGNON β οΈ π» |
This project follows the all-contributors specification. Contributions of any kind welcome!