#dev 2025-12-22
2025-12-22 UTC
[Sophia_wood] joined the channel
#
autumnlilybug gRegor: It will! I would prefer if you send a GET-style webmention, if only because I wish more people were looking at it, but POST-style webmentions work perfectly fine.
#
autumnlilybug gRegor: Not exactly. It isn't fully static, but it can't *send* POSTS automatically because there's no way for it to tell whether a post of new at runtime, since their content is static and part of the repo. There's no CMS.
#
autumnlilybug Essentially I can make any given URL non-static, but the default is static and imo static blog posts are better than fetching them from a DB if given the option
#
autumnlilybug [edit] Essentially I can make any given page non-static, but the default is static and imo static blog posts are better than fetching them from a DB if given the option
#
autumnlilybug (if you're curious about how exactly it works I recommend looking into how the Astro framework works)
#
autumnlilybug :D
chrisaldrich, Pixi and Paul_0904 joined the channel
#
autumnlilybug either of those tricks would be inconvenient at least to implement in Astro
#
autumnlilybug they would need to be either separate from the build process or built as Vite plugins, the prior of which could use git or a file of hashes to detect new files (but would need special handling to avoid sending webmentions for unpublished/hidden posts have issues with renames and edits) and the latter would be tricky to automate in such a way that dev builds don't accidentally trigger webmentions for unpublished posts
#
autumnlilybug Exactly, which requires special handling
#
autumnlilybug True
#
autumnlilybug Hm
#
autumnlilybug I guess if
#
autumnlilybug Ok hold on
#
autumnlilybug Script runs on every build as a hook in the yarn build command
#
autumnlilybug First it looks for a data file, loads it if present, otherwise creates a blank one
#
autumnlilybug File has to contain a unique post ID (slug?) for each post where a webmention has been sent
[Al_Abut] joined the channel
grufwub joined the channel
#
autumnlilybug Then, at least for my setup, it has to read every post and look at the frontmatter (yaml block at the start of the markdown encased in ---). If that post's ID is in the list, skip. Otherwise, if it is marked as published, figure out it's URL and send a webmention to every link in the post (involves discovering endpoints for various hosts - could be cached??), then add to the list
#
autumnlilybug ulhar4409[d]: For my site, if I commit to the remote repo Cloudflare automatically rebuilds and redeploys from that commit. Adding a new post just means writing an MD(X) file in the correct directory, commit+push, then wait until it redeploys. The only hooks available are git precommit hooks, GitHub actions and the custom `yarn cibuild` action run by the Cloudflare deployment process
#
autumnlilybug ulhar4409[d]: Yeah, currently my unique post IDs are the posts' filenames which are also used as their slug
#
autumnlilybug So `src/content/blog/new-post-xyz.md` is displayed at `https://seaglade.dev/blog/new-post-xyz`
#
autumnlilybug But yeah, a git precommit hook is imo not a good solution. GitHub actions *could* work but if the Cloudflare deployment fails and the action does not I've sent out invalid webmentions which is not great. So the yarn step is the only reliable way to handle it.
#
autumnlilybug Actually, I suppose instead of `cibuild` it could hook into `deploy` (my Cloudflare config runs the build command then the deploy command) which might be slightly better as it implies that the current build *is* getting pushed to prod
#
autumnlilybug But regardless I would have to write the automation in JS and persist the state outside of the repo in order for it to run in the CF redeployment process.
#
autumnlilybug ulhar4409[d]: That's true
#
autumnlilybug The build server doesn't strictly know the URLs already but they can be detected by reading the filenames of files under the content subfolder for the blog so that's not the hard part
#
autumnlilybug Really the issue is state management. A GH action can store the state in the repo, but it can't guarantee that invalid webmentions are never sent. A hook into the deployment process on Cloudflare can guarantee that only valid webmentions are sent but must have an outside system to maintain state which it has to both read from and write to
#
autumnlilybug All in all I don't think it's practical for me to automate it in my own system, not to say that automation wouldn't be beneficial, but the effort to make a functional system is too high compared to simplifying the process of manually sending webmentions (which is the point of GET-style webmention)
#
autumnlilybug Perhaps but then how do I write to it?
#
autumnlilybug I could build an API on my site that handles it, maybe with a backing DB or just a JSON file on R2 (S3 equivalent) but then for my deployment to succeed the existing site must be working which is a strange issue.
#
autumnlilybug ulhar4409[d]: But the automation cannot make a git commit (if running on CF) and therefore cannot store the state in the repo
#
autumnlilybug Think of the deployment as a read only process - it can write files to its workspace but there's no way to get them back to the upstream repo directly so that's no good on its own
#
autumnlilybug ulhar4409[d]: A Cloudflare worker running my built astro bundle
#
autumnlilybug Lemme see if I can explain the local-to-prod pipeline for my site without going overboard lmao
#
autumnlilybug 1. I write the code on my computer (ofc) 2. I commit that code to the repo and push it to GitHub 3. Cloudflare sees a new commit and creates an ephemeral workspace to run the CD script 4. Cloudflare installs dependencies in the workspace, runs the build command, and then runs the deploy command (which uploads the build bundle to the Worker as a new deployment) 5. Cloudflare reports success or failure to GitHub, and simultan
#
autumnlilybug It kind of is? It's complicated.
#
autumnlilybug It is until it isn't. Basically it's an SSG except you can set it up with an "adapter" (node, CF workers, etc.) and then you can say "this page is rendered at runtime rather than build time" (among other things) and it will statically generate everything it can and then generate a JS "server bundle" that can handle the runtime stuff
#
autumnlilybug So, for my site, everything is 100% static except for my webmentions API endpoint (fully dynamic) and the comments at the bottom of each post (there is a static placeholder with a static JS snippet that is used to stream the real dynamic content from the server after the page loads and then replaces the placeholder - Astro calls it Server Islands)
#
autumnlilybug I really like Astro because of all of this, it feels like a pure SSG but if you need SSR you can opt-in to it for just the parts that actually need it
#
autumnlilybug But it does put it in a weird spot relative to pure SSGs like Hugo and pure SSR frameworks like Next.js (next.js SSG mode is cursed do not use it)
#
autumnlilybug ulhar4409[d]: Lmao yeah
#
autumnlilybug It's what Remix wants to be, with its Partial Prerendering stuff. I used to like Remix a lot but then I tried Astro, realized how much I had been fighting with Remix to get it to work exactly the way I wanted, and switched immediately.
#
autumnlilybug ulhar4409[d]: Oh, and the other thing Astro does is it has a thing called "Islands" where everything is static HTML without any reactivity or hydration or anything but you can write a component in almost any major UI framework (I like Svelte, you can also use React or Preact or Vue or a bunch of other things) and then import it and Astro will only hydrate that component, so you don't have to choose to either use a frontend
#
autumnlilybug And because islands are isolated you can use multiple frameworks at once
#
autumnlilybug You could have Svelte, React, Vue, Angular and Solid components all running together in one page. Why? Great question. But you could.
#
autumnlilybug So there's no frontend-framework-lock-in
#
autumnlilybug One thing I built a while back uses Svelte for all of the reactive components except for one, which is an audio player built in React because for some reason Svelte couldn't handle seeking
#
autumnlilybug Lmao
#
autumnlilybug Sorry for the preachy wall of text T-T I really like Astro and I wish it got more attention
#
[Al_Abut] Ugh, I did that thing where I built up way too much state in Chrome Inspector to dial in a look for a page and now I have to painfully recreate it in the code editor. I’m sure there’s a better way to do this…
rosipov1, chrisaldrich, [tantek]1, IWDiscord and [Murray] joined the channel
[Schepp] joined the channel
#
bugsmith [edit] I've noticed that [Micropublish.net](https://micropublish.net) can send articles as form-urlencoded requests. They look like this:
#
bugsmith ```
#
bugsmith *type=h-entry
#
bugsmith &*subtype=article
#
IWDiscord <bugsmith>
#
bugsmith &name=foo bar
#
bugsmith &content[][html]=<div>foo bar baz</div>
#
bugsmith &category=foo, bar
#
bugsmith &post-status=
#
bugsmith &visibility=
#
bugsmith &mp-slug=
#
bugsmith ```
#
jamietanna [edit] https://arc.codes/ is good - it's what barryf uses for Vibrancy and I'm using it for a few things - handles easier AWS Lambda setup
#
[Jamie_Tanna] [edit] Do many folks implement support for https://github.com/indieweb/micropub-extensions/issues/33? Possibly just me and barryf, but maybe Micro.blog via Manton?
#
jamietanna[m] [edit] Sorry snarfed not right now. Kinda hoping to move over to https://github.com/barryf/vibrancy/ before long, but not yet taken the plunge
#
[jamietanna] [edit] https://github.com/barryf/vibrancy/ is quite good by barryf, and is all in the AWS free tier
#
jamietanna [edit] barryfrost's Vibrancy is another example of the GitHub API for Micropub https://github.com/barryf/vibrancy/blob/b5281074454e999ad86f0d0195f8570223882163/src/events/write-file/github.js
[artlung] joined the channel
[artlung] and thegreekgeek joined the channel
[manton] joined the channel
#
GWG Can you two add your interest to https://indieweb.org/pop-up#Micropub and I'll put up another voting matrix for January?
barnaby joined the channel
barnaby and claudinec joined the channel
#
[Al_Abut] [Murray] I’m sure Chrome has all kinds of fun tools that I’ve been willfully ignorant of, being the unfrozen caveman that I am. I’ll give “copy all changes” a try!
#
[Al_Abut] The thing I was wrestling with last night was adding more subtle ASCII art touches to my project tracker: https://alabut.com/projects/
[KevinMarks], barnaby, [aciccarello], JunityCat, troojg and CrimeWave joined the channel
