Pelican Website Debut!

Posted on March 3, 2018

The day is finally here, I rewrote my website with Pelican and it's live! It's crazy that I wrote a post over two weeks ago thinking I was almost ready to put my site up. It turned out there was more tweaking I wanted to do, which is good. I was thinking I'd put it up in a much more raw state, but I've managed to put a lot of work into getting everything exactly the way I wanted it. I'll write a tutorial post on everything I did to finally get this thing up. I was probably a bit of a control freak about layouts and organization, and I waffled a bit in these areas which certainly didn't help. But finally it's live and I can heave a sigh of relief.

I meant to write down all the little pitfalls I got myself into so I can put them on here for posterity, most of them were figuring out how to use Jinja though. Jinja's great, you can write Python functions that Jinja can use to control how content is displayed. It amounts to writing less HTML and more Python. It also makes the process less repetitive. You can write HTML snippets that you can reuse in multiple places on different pages. The only downside to Jinja is that I really don't understand it which definitely shows in my code (please help!), but I got things working the way I wanted. I figure I can always clean up the code later, but I really wanted a final product for all of the labor I put into the site so far.

The python code is pretty straightforward. I realize that I love Python to death, I just don't like some of the libraries. Some are really nice, though. I had a lot of fun with Fabric, which gives you a file you can fill with python functions to quickly perform repetitive work. I realize this is a poor explanation so here's an example. When I first started debugging layouts, I would clean out the folder with all of my web pages and rebuild the pages. Fabric makes it really easy to write a new function that does both of these tasks, so all I have to do is call the new function. That one function alone saved me probably an hour.

One thing that I expected to be a pitfall but wasn't, was the (admittedly minimal) javascript I wrote for the site. It's a super simple dropdown menu, but I haven't used jQuery in a year probably and I thought it'd be harder to figure out. I now remember why jQuery is such a great library. Originally I was trying to use Bootstrap, but then I realized Bootstrap is awful now if you're not using a compiler so I decided to roll my own styles. It's funny, I spent probably three hours farting around with Bootstrap, and it took me half that to completely revamp my stylesheets. I have a lot to say about Bootstrap, but I'll save it for another post. My lovely girlfriend is leaving town for a week so I will have a lot of time to get down everything that I've been wanting to say since starting work on the site. Anyway, it's getting late, that's all for tonight.