I have a chicken and egg problem.
When I publish a blog article I want to include a link to a corresponding Mastodon post. To write the Mastodon post, the article needs to be live. But to publish the blog article, I need the URL to the Mastodon post. But I don’t know the Mastodon post URL until I publish it. Ahhhhh!!
Am I really going to have to deploy my site, post a toot, then turn around and add the link to my site and deploy again? Ugh, there’s got to be a better way.
@bw Write a placeholder Mastodon post and then edit it after publishing the blog post? That's probably even worse than editing the blog post after publishing though. :)
@jcsteh Yeah I thought maybe I could post privately, get the permalink, publish the article, then make the post public. But it looks like once you set a post to “only people who were mentioned” you can’t make it public later.
@bw Yeah, that's annoying, you can edit a post's content but you can't change its visibility.
@bw same, I've just resigned to editing the blog post
you could probably do this with some sort of webhook
@anniegreens Yeah, hmmm.
@anniegreens @bw kinda sorta yep! I use @nhoizey’s action + @DavidDarnes's Mastodon embed web component. The workflow adds a cache file to your repository, I import it into an 11ty data file, pass the Mastodon post URL it includes after syndicating to a filter that converts it to the format the web component expects and then renders the embed *if* that URL is available on the next build.
@anniegreens @bw it's not as painful as it sounds https://coryd.dev/posts/2024/automatic-mastodon-post-embeds/