Make a Static Website with Python
2023-02-26
When I decided to have my own website, I read many blog posts written by others explaining how they made their own. And I found them useful. So I thought I would write about what I learned, and how I finally made my own website.
Why?
I haven't been on social media for about two years now. You may find my name on Linkedin, but I don't use it often, and I strongly dislike the platform for various reasons (whole other topic.) I still wanted to have some sort of online presence. And I enjoy writing.
Hence this website.
Why "ricecake"?
Because it's odd enough to be memorable, and, ricecakes are decent carriers of cheese and hummus and the like.
How?
At first I tried Hugo. Hugo is a static site generator written in the programming language Go. After playing around with it for a week (and making a minimum viable website), I realized I either have to commit to learning Go, or every time I want to make the slightest change to my website, or to troubleshoot, it would take me time and effort to search online and figure out what I should do. Learning Go was not my desire or priority, and I wanted a website that I can fully control.
So I decided to write it in Python (a language that I do know), from scratch. I used Logan Donley's video tutorial as the basis. Once I felt I had the bare bones, I added pages, made a tagging system, and organized the website the way I wanted.
The pages that will not change frequently (like the home page) are written directly in html and rendered with Jinja2. Individual posts are written in Markdown, and rendered into html using python's markdown package, and jinja2.
I don't enjoy reading on bright screens, but I also know that many people don't feel comfortable reading on dark backgrounds. So I went for a soft, mute color for the background, and used an online color pallette generator (there are many if you search), and went with colors that looked good to me.
For other styling elements, I got ideas from websites I found visually pleasing. Bit by bit, I added more to the css file, and it came to be what you see right now.
Final Thoughts
The experience of making this website was very rewarding, and not too complicated. I (unfortunately) don't have too much patience when it comes to building stuff from scratch, and making this website was just the right blend of challenge and reward for me.
If this helped you, or you have questions on how I made it, feel free to send me a message: ricecake [at] ricecake [dot] space.