simonw / til

Today I Learned
https://til.simonwillison.net
Apache License 2.0
1.08k stars 85 forks source link

Social media cards missing syntax highlighting #75

Closed simonw closed 1 year ago

simonw commented 1 year ago

e.g. https://til.simonwillison.net/sqlite/python-sqlite-memory-to-file

It looks like this:

image

Should look like this:

image
simonw commented 1 year ago

Here's the problem: https://github.com/simonw/til/blob/1bec2899b5eac0d7ab4212edf41266bbfd1a0aa1/templates/pages/%7Btopic%7D/%7Bslug%7D.html#L15

I generate the HTML on disk and then take a screenshot of that HTML file - but that relative link won't resolve to a CSS file.

simonw commented 1 year ago

That's going to require regenerating all 410 screenshots AGAIN - for the third time - because the template hash will have changed.

simonw commented 1 year ago

It's working: http://s3.amazonaws.com/til.simonwillison.net/aad395a26e49b35b85798523aa2b1e06.jpg

image

simonw commented 1 year ago

Fixed and deployed.

https://til.simonwillison.net/pytest/registering-plugins-in-tests is a good demo:

https://s3.amazonaws.com/til.simonwillison.net/8dda22f3aab0e3224aa6b2c330b07af3.jpg

image

In the Facebook debugger: https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Ftil.simonwillison.net%2Fpytest%2Fregistering-plugins-in-tests

image