here

Weeknotes 022 - PhantomJS and Jeans

What even happened this week, it's all kind of a blur? So a little bit of behind the scenes shop talk then.

This website runs on a very slim NodeJS backend. It's there to handle the simple URL routing, and pretty much "Server Side Includes." Making sure the same headers and footers get pulled in from a single file, the usual stuff. But everything else in this post is handwritten in HTML. Each time I make a new post, I open up a text editor, start with the <h1></h1> header tags and then go from there.

I did this so I could have full control over the HTML, and potentially make each post look and feel different. Of course, I haven't done this because generally don't have time. I've slowly built up some CSS that I like and stick with it.

I enjoyed making the <canvas> background on these two posts (not on mobile)...

...and the little sidenotes on this long-ass post...

But one thing kept bothering me.

The act of deploying this site involves me writing the HTML, then running a "build" step to flatten some of the pages, updating the RSS feed, and finally using PhantomJS to create an image of each new page for the Open Graph meta tags. So when this gets posted to Facebook or Twitter, it makes a nice preview.

However for reasons I don't care enough to get to the bottom of, PhantomJS doesn't handle the background of the page's CSS "cover" mode. Instead of doing what you'd hope, i.e. having the whole image in the background of the preview, it seemed to zoom into the top left corner, examples below.

This finally annoyed me enough to add about three lines of backend code that detects when PhantomJS is loading the page and adds in some special CSS to set the background to 1,920 by 1,080.

Which means, fingers crossed, when I post this to twitter, it should look much better.

Keeping a website running is nothing but endless thrills I tell you.

👨🏼‍💻 👨🏼‍💻 👨🏼‍💻

In more utterly mild news, I bought some new Jeans.

I got tired of the Levis I kept buying wearing out in ways I couldn't easily repair. I just can't do crotches.

I opted for some Huit jeans because, in theory, I can send them off to be repaired properly.

Part of the whole jeans thing is that they're not supposed to be washed for six months. Giving then time to crease in all the right places, fit to your shape and become your own.

I'm also the type of person that in a pandemic lockdown throws all their clothes into the wash as soon as they've gotten back from whatever horrid shopping trip out they've had to have made, because of the scary outside virus.

As I'm not supposed to wash them for six months, and I wash anything that I wear outside, meaning I'm now the proud owner of some smart inside jeans.

I'm kinda enjoying the routine of getting dressed "smartly" with no intention of going anywhere.

👖 👖 👖


Trackbacks

🔗 🔗 🔗


Blatant self promoting calls to action

You should totally follow me on these social medias, but mainly Instagram

https://instagram.com/revdancatt
https://facebook.com/revdancatt
https://twitter.com/revdancatt



https://www.pinterest.co.uk/revdancatt
http://youtube.com/revdancatt
https://www.linkedin.com/in/danielcatt/
https://revdancatt.com/feed
📸 👍 🐦
This page has been viewed
0000105
times since April 10th 2020