Re-Introducing First Crack
When I started blogging, I bounced around between places like Zoomshare, FreeWebs, and WordPres. Nothing fit, though, and so in 2011 I built my own content management system. I started running my website on First Crack a few months later. Easy, fast, and portable, my engine has no dependencies, builds a static website of over one thousand pages in less than two seconds, and works just as well as a server daemon as it does on my home machine. I stopped posting public updates to the code base in 2015, but kept working on the project in private. Today I re-release First Crack to the world.
Check out the repository for installation, setup, and usage instructions. In brief, though, just download the files and run
blog.py. First Crack will take care of the rest. Here, I want to talk about the steps I took to build an easy, fast, and portable blogging engine.
Above all else, I wanted to build First Crack with stock Python. Developers abandon projects all the time, and I did not want to put a critical feature in someone else’s hands. Relying on one or more third-party functions would have made setting up First Crack harder, too. I also could not count on others to prioritize speed. Take, for example, checking file extensions.
filename.endswith(‘.txt’) takes about three times as long as
‘txt’ == filename[-3:], and four times as long as
‘.txt’ in filename. This change alone sped my engine up by almost 25%. This approach did have some downsides, though. It meant a ton of work at first, and then even more debugging and working out edge cases. In exchange, I had full control of every aspect of the project. I could optimize every little detail for peak performance, and avoid wasting time creating runtime environments on new systems. That seemed worth it then, and I stand by that choice now.
I also wanted to make First Crack easy to use, which meant hiding a lot of work behind the scenes. I wrote, re-wrote, and wrote again functions for parsing Markdown, working with files, and building valid HTML documents and RSS feeds. This gave me an engine that not only ran anywhere and ran fast, but also one that turned simple Markdown files into a feature-rich, metadata-heavy blog, without any input from the user. The user can get into the weeds if they want to, but they don’t have to. I worked hard to make that possible with First Crack. Just give it a flat directory of plain text content files, and it will do the rest.
After almost a decade, content management systems have gotten much better since I started this project. Today, I have no doubt I could make something like Squarespace or WordPress work for me. I have yet to find anything First Crack cannot do, though, or an engine that wins out in ease of use, speed, and versatility. I like working on First Crack, and I look forward to adding cool new features in the future. I hope you will give it a try, and I hope you will let me know what you think.