Add Mastodon syndication support via Bridgy#145
Open
danielmatthew wants to merge 1 commit into
Open
Conversation
- Add microformats2 markup (h-entry, e-content, dt-published, u-url, p-name, u-syndication) to the notes post template so Bridgy can parse posts for syndication - Add optional syndicationUrl field to posts schema; when set, renders a visible "View on Mastodon" link instead of the hidden Bridgy target - Add webmention and pingback endpoint links to BaseLayout head for receiving backfeed (requires one-time webmention.io registration) - Add GitHub Action that fires on pushes to main when posts change, waits for Netlify deploy, then sends webmentions to Bridgy Publish https://claude.ai/code/session_011QXNRDSYqNMS9wQQTTtJHx
👷 Deploy Preview for danmatthew processing.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for syndicating blog posts to Mastodon using Bridgy's webmention publishing service. It includes a new GitHub Actions workflow to automatically send webmentions when posts are published, microformat markup for proper syndication, and webmention endpoint configuration.
Key Changes
New GitHub Actions Workflow (
syndicate-to-mastodon.yml): Automatically detects new or modified posts in thesrc/content/posts/directory, waits for the Netlify deployment to be live, and sends webmentions to Bridgy Publish for Mastodon syndication.Microformat Markup (
src/pages/notes/[...slug].astro): Added h-entry microformat classes to the post template:h-entryon the article elementdt-publishedon the publication datep-namefor the post titleu-urlfor the canonical URLu-syndicationfor syndication linkse-contentfor the post contentWebmention Configuration (
src/layouts/BaseLayout.astro): Added webmention and pingback endpoint links to enable receiving webmentions from other sites.Content Schema Update (
src/content.config.js): Added optionalsyndicationUrlfield to post frontmatter to track syndicated copies of posts.Implementation Details
The workflow waits up to 5 minutes for the site to be deployed before sending webmentions, ensuring the new content is live and discoverable. Posts are identified by their filename slug, and the syndication URL is constructed as
https://danmatthew.co.uk/notes/{slug}/. The microformat markup enables Bridgy to properly parse and syndicate the content to Mastodon.https://claude.ai/code/session_011QXNRDSYqNMS9wQQTTtJHx