Posts tagged with 'Meta'
Wednesday, 14 December around 6 o'clock pm
The very first post on this blog was about how I wanted a completely static blog and how it'll be great and wonderful and boy howdy was it ever. Over 500 lines of rather dense perl plus almost 20 separate template files because the kind-of-mustache that I decided to implement can't handle inlined templates for loops so I have to do everything as partials.
Needless to say, it isn't very fun to work on. It mostly does what I want but adding new things is pretty painful, as is changing any of the templates. Yesterday I decided that I would see what a Sinatra port would look like. Why Sinatra? It's fun, that's why. Ruby and Sinatra make writing new webapps easy and fun.
Tagged:
Meta
Read More -
permalink
Monday, 29 March around 8 o'clock pm
Someone at work today demanded that I add an RSS feed, so here you go: atom. It didn't take very much to hack it in. Basically, all I had to do was install a few more CPAN modules, specifically DateTime::Format::Natural, DateTime::Format::W3CDTF, and finally XML::Atom::SimpleFeed. The first two are so I can put natural-looking dates in my entries and still be able to get full-fledged DateTime objects out of them, and the second is to save me the pain of writing out the Atom format's preferred datetime format. Also, I get neat date formatting in blog entires almost for free with the CLDR syntax.
Another thing to notice: File::Slurp instead of my own read_file_contents and write_file_contents. It works just as well as mine, except it's more sensitive to list vs scalar context.
Tagged:
Meta
Read More -
permalink
Sunday, 28 March around 10 o'clock pm
I'm a strict believer in learning by doing. It's how I learn best. In the spirit of learning, then, here's how I built the engine that powers this blog.
Right away I decided that there's no point in having a database to back this thing. The only useful thing that a database brings to the table is comments, and those are way more hassle than they're worth. Better to leave the comments at reddit or hacker news, where they already know how to deal with spam. Not having to worry about a database freed me up to worry about more important things, like how to put text on the screen. I'm most familiar with perl at the moment so I decided that the best way to build it would be a client-side script that generates some static html.
Current features:
- Absolutely no database
- Generates fully static html
- Automatically ships it to my server
- A really cheesy template system because I didn't want to learn Template::Toolkit just yet
- Archives for everything, and only show the last 10 entries on the front page
- Static pages (although currently there aren't any)
- Markdown parsing for entries
If you want to see the source for it (including all the entries), it's on github, but I warn you it's kind of lame. The template system in particular is not really what I want it to be yet. It's non-recursive, so publish.pl basically acts like the top-level template. I'll probably end up converting it to Template::Toolkit at some point.
Tagged:
Meta
Read More -
permalink