Note from 3 June 2022
Looks like the nasty bot finally stopped smashing my photography site! 🎉
-
older note:
Note from 27 May 2022 -
newer note:
Note from 4 June 2022
Looks like the nasty bot finally stopped smashing my photography site! 🎉
Updating webmentions on a static site
When I started using Webmention on this site (more than 5 years ago!), I was building the site on my local computer, and uploading the build result on my hosting with rsync. I've moved to Cloudflare Pages 6 months ago, which means webmentions where updated only when I pushed new content to GitHub. Here's how I fixed that.
To have different builds for #Cloudflare Pages previews, I found if-env
and the CF_PAGES_BRANCH
variable:
{
"scripts": {
"build": "if-env CF_PAGES_BRANCH=main && npm run main || npm run preview"
}
}
If you want to run a #GitHub Action after a #Cloudflare Pages build is done, you can use @WalshyDev's Action: https://github.com/marketplace/actions/cloudflare-pages-await
I hope Cloudflare Pages will get triggers like #Netlify: https://docs.netlify.com/functions/trigger-on-events/
Some tools transform URLs into links, but if the URL was inside parentheses, the link href
sometimes contains the closing )
, so the user gets a 404 error… 🤦♂️
Fix this on #Cloudflare Pages with a _redirect
file:
/*) /:splat 301
Looks like some people now see my site on #Cloudflare:
I wonder how, as I switched the DNS yesterday evening, and all DNS checks still show propagation has not started yet: