A little more progress on omgloldev tonight: I put the conditional logic in the haml template such that if you visit
/preview, you get a fully rendered demo page. If you visit
/raw you get the raw template code in a text area with a button to copy the code to your clipboard.
The thing I’m going for is a way to develop my weblog.lol blog using HAML and Sinatra niceties (e.g. partials) with a decent working preview, then render the composited templates out into the right location for weblog.lol’s publishing action to pick them up and publish them when I push to the repo.
It’s not too far off for that purpose now:
- I edit the haml in Sublime. That’s comfortable and familiar.
- I run the app to get my preview server.
- I can visit the
rawview and copy the text and paste it into the “production” template, then push the changes up to GitHub to kick off the publishing action.
There is a bug in the template right now that is causing some problems. I’m not sure if it’s just me hurrying or if I’m running into some HAML peculiarities that are messing with how things are nested. That’s for tomorrow or the weekend.
Longer term, I want to break the parts that weblog.lol makes you keep in one file (the CSS, things that naturally belong in a partial) so that I can work on them in discrete editor views. Those things can all just be HAML or CSS partials that get sucked in to make the monolithic HTML that weblog.lol wants.
Part of The January Plan was to start being a little more structured about things.
I’ve been paying more attention to where my time goes during the day: I’ve got specific things I definitely want to accomplish before 5, things I want to get to on a regular cadence, etc.
But it has been years since I’ve just played around with any kind of coding, and I could spend my day doing things like this. As it is, I’m bucketing it to my discretionary time and beginning to think about how all the things I like to do need to come together with things that demand more structured time (and eventually synchronization with humans).
So this is a slightly silly project I could accomplish other ways, but it’s getting me back into the flow of something I like to do, with all the fun, iterative learning and fiddling and tweaking. It feels good to do it, even if it doesn’t mean much.