I run this blog, a small corner of the Internet where I share my thoughts and hope to connect with others who think alike. To grow, I need to put my ideas in front of the best professionals out there. That’s not easy anymore: Google and other search engines are shifting toward AI responses. Depending on the topic, this has cut organic traffic by up to 30% for big sites. For smaller blogs like mine, it’s even worse - search engines and AI prefer authoritative sources such as Wikipedia or government websites.
So how can I get some of that traffic back to my blog?
Social Media!
I’ve already noticed that some of my articles spark more discussion outside my site - on Reddit or Hacker News .
I’m not a heavy Reddit user though; there’s too much noise, and scrolling through it daily to catch 1 or 2 good threads doesn’t appeal to me. On the other hand, the Fediverse 1 feels like an exciting new world and a potential source of readers - though I could also live without constantly posting there.
So how can I stay active without wasting time manually pushing articles to every platform?
The answer is simple: I’m a DevOps. I know how to duct-tape and automate things 😉.
I found crosspost
2, a tool that supports many social networks. It looked like a good start, but it lacked logic for pulling fresh posts from my blog.
Inspired by indexnow-action
3 (which I already use), I built my own crosspost-action 4. It’s mostly a wrapper around crosspost
2, with added logic to fetch from a Sitemap or RSS/Atom feed, sort entries by freshness, and post them to configured social networks.
This way, I can publish new posts to my socials every day - automatically - without lifting a finger 😎.
How to set it up
I use Hugo and GitHub Actions to publish my static site. To enable crossposting, I added a workflow file: .github/workflows/crosspost.yml
.
name: Crosspost recent posts to Social Media
on:
# Uncomment for debugging
# push:
# branches:
# - master
schedule:
- cron: '5 17 * * *' # every day at 17:05 UTC
jobs:
crosspost:
runs-on: ubuntu-latest
steps:
- name: Run action-crosspost on my RSS feed
uses: tgagor/action-crosspost@v1
with:
dry-run: ${{ github.event_name != 'schedule' }}
feed-url: https://gagor.pro/index.xml # my RSS feed
since: '1'
since-unit: day
mastodon-access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
mastodon-host: mastodon.social
message: |
New blog post: {url}
#blog
exclude-urls: | # ignore these
https://gagor.pro/
https://gagor.pro/about/
You’ll need to define secrets for access tokens and API keys, then pass them into the action. Once configured, your posts will be published automatically.
Sitemap or RSS?
At first, I thought the Sitemap would be the perfect source for fresh posts. But Sitemaps rely on the lastmod
attribute, meaning that if I update an old post, it might be republished as “new.” That can spam social feeds and annoy followers.
Instead, I switched to RSS, which uses the published date. This works much better and avoids reposting updated content.
The action also supports filters and exclusions, so you can easily fine-tune which URLs get posted.