Blogging With Pelican and publishing on GitHub Pages
Blogging with Pelican, because hey it has .rst support, it's written in Python and it has the biggest number of stars on GitHub.
Why Pelican:
- You writing .rst Pelican transfer this into HTML, COOL
- It's fast because it's static, no database
- Hosting it's cheap, because it's FREE, GitHub Pages
- It's Python
Install Pelican. I'm installing it globally with my package manager but feel free to put it into separate virtual environment if you want.
Scaffolding the project: pelican-quickstart
Set up settings pelicanconf.py Use the documentations for reference: .. _PelicanDocumentation: https://docs.getpelican.com/en/stable/
- Important setting for us is:
OUTPUT_PATH=''
We use this setting to tell Pelican where to output the generated HTML files. In our case is pretty convenient this to be our GitHub Pages Repository. Because of this setting we can delete the default output folder generated from the scaffolding.
We can use non-default theme downloaded in our root project, in our case in the theme folder. The theme location is referenced in the pelicanconf.py
We write content in .rst format in the /content folder.
Generation of the HTML is done with 'pelican content'. That put the HTML files in our GitHub Pages repo previously set up in pelicanconf.py
Go to this GitHub Pages repo and push to GitHub.
You are live.