coltrane
A Dynamic Site Generator that harnesses the power of Django without the hassle π΅
π 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
- Deployment best practices with
whitenoiseandgunicornalready configured - Leverage the power of built-in
Djangotemplates, template tags, and filters inside markdown files - Any custom template tags and filters are enabled automatically for use in
markdownor HTML templates - Include any third-party
Djangoapp for additional functionality - Optional static site generator to output HTML files
- Able to be integrated into a regular
Djangoproject as a third-partyDjangoapp
β‘ Quick start
mkdir new-site && cd new-siteto create a new folderpoetry init --no-interaction --dependency 'coltrane:<1' && poetry installto create a new virtual environment and install thecoltranepackage- Optional:
brew install watchmanon MacOS for less resource-intensive local development server poetry run coltrane createto create the folder structure for a new sitepoetry run coltrane playto start local development server- Go to http://localhost:8000 to see the original markdown rendered into HTML
- Update
content/index.md - Go to http://localhost:8000 to see the updated markdown rendered into HTML
- Optional: run
poetry run coltrane recordto build static HTML files
Generated coltrane file structure
.
βββ __init__.py
βββ app.py
βββ content
βΒ Β βββ index.md
βββ data
βββ poetry.lock
βββ pyproject.tomlπ 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
π 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!