Always keep a backup. That’s the motto, right? And that was mistake number 1.
Mistake number 2 was an rm -rf on the wrong thing. Knifes are sharp. Cut away, and stay in school.
On the plus side, the only major loss which was covered elsewhere was this blog. And I did have a “copy” of that in the S3 bucket. So… all I had to do was pull it back, reverse engineer it, use it as a comparison and pull stuff back in.
hugo lessons learned
- It worked! Static site generators - I use Hugo - are nice for a lot reasons… this just cements that in my mind. So reproducible.
- It’s been a while since I setup a site from scratch. Not that that’s a whole lot to it, but this time it just felt smoother. Not sure that it was my familiarity, or if it’s a bit more mature. Either way, pretty smooth.
- When rebuilding this way - you gotta refrain from making all those fixes that you want to: no fixing typo - even small ones (e.g. whitespace cleanup); not fixing the input even if there’s a bug you worked around that is now fixed; no fixing broken links on remote sites that have bitrotted out; no fixing the tags/categories that have grown organically. All fixes make the static build not match and that breaks the rebuild down.
- Unicode is hard - copying and pasting and seeing differences between editors over time all lead to unicode charaters (accented ‘, “, etc) sneaking in. This make it hard to compare because some are interpreted and some aren’t. I got into a consistent pattern “matching forward” until one post was completely the opposite, so trying to fix it was counter to what was supposed to happen. Sigh.
- Line lengths are hard. When writing the blog article, I was trying to keep a line length limit to make it readable. However, HTML is honey badger - it doesn’t care. So copying stuff back and forth after it’s browser rendered - just isn’t fun.
- Daylights Savings time makes guessing timestamps hard. Hugo renders without timestamp, and I didn’t feel like looking it up for every post, so I guessed. Should probably fix that (though, it doesn’t actually matter with how it’s rendered…).
- Remember to clean up your public directory on occassion. If you change out templates or other static files… they don’t necessarily go away. Probably should remove public and rebuild regularly (like… every push).
So - you can do. It wasn’t too bad. Actually was pretty good. But given that I only have 25 posts, it wasn’t onerous. If there were more, I really would have done it a bit more automatically (probably should have with 25, but… eh…).
Kinda got 4 big things out of this one:
- Yea, (well past) time to get a backup on the laptop. Got one on the desktop machine, but most of the items on the laptop are tied to some service and backed up there… but not everything.
- I really should proof read my writing. I’m not good about this, and looking back over stuff, I really should be. I do sometimes do a quick once through on the writing, but most of the time, it comes out more raw than that. So… something to work on there.
- 2015 was not a pretty year. I didn’t write anything last year, and on top of that, some of the ones I thought I wrote last year are actually 2 years old. I know work was a bit demanding last year, but I’m still realizing how much it took out of me.
- Related to #3: I have a bunch ideas, a smaller number get written down, and an even smaller get something real put to them. I’d like to get a higher conversion ratio there.