Skip to content

Commit 8612097

Browse files
committed
feat(marketing): add automated blog-to-X tweet pipeline
Replace the template-based distribution system with an automated tweet pipeline that actually posts to X via the API. - marketing/tweet.sh: reads `tweet` field from blog post frontmatter, appends the post URL, and posts via X API v2 (OAuth 1.0a) - .github/workflows/tweet.yml: auto-tweets when blog posts with a `tweet` field are merged to main - marketing/SETUP.md: step-by-step guide for X API keys, .envrc setup, and gh secret set for CI - Add `tweet` frontmatter field to all 7 blog posts - Makefile: `make tweet` and `make tweet-dry` targets Closes #4
1 parent 3dda082 commit 8612097

15 files changed

Lines changed: 279 additions & 356 deletions

File tree

.github/workflows/tweet.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tweet New Posts
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "content/*/module.md"
8+
9+
jobs:
10+
tweet:
11+
runs-on: ubuntu-latest
12+
if: github.event_name == 'push'
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 2
17+
18+
- name: Find changed blog posts
19+
id: changed
20+
run: |
21+
changed=$(git diff --name-only HEAD~1 HEAD -- 'content/*/module.md' | grep -v '^content/docs' || true)
22+
echo "files<<EOF" >> "$GITHUB_OUTPUT"
23+
echo "$changed" >> "$GITHUB_OUTPUT"
24+
echo "EOF" >> "$GITHUB_OUTPUT"
25+
26+
- name: Tweet changed posts
27+
if: steps.changed.outputs.files != ''
28+
env:
29+
X_API_KEY: ${{ secrets.X_API_KEY }}
30+
X_API_SECRET: ${{ secrets.X_API_SECRET }}
31+
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
32+
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
33+
run: |
34+
echo "${{ steps.changed.outputs.files }}" | while IFS= read -r file; do
35+
if [[ -z "$file" ]]; then continue; fi
36+
slug=$(basename "$(dirname "$file")")
37+
tweet_field=$(awk '/<details>/{f=1;next} /<\/details>/{if(f)exit} f' "$file" | grep '^tweet:' | head -1)
38+
if [[ -z "$tweet_field" ]]; then
39+
echo "Skipping $slug — no tweet field"
40+
continue
41+
fi
42+
echo "Tweeting for: $slug"
43+
./marketing/tweet.sh "$slug"
44+
done

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
public/
22
.DS_Store
3+
.envrc

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build serve dev clean distribute
1+
.PHONY: build serve dev clean tweet tweet-dry
22

33
build:
44
hype blog build
@@ -18,5 +18,8 @@ docker-build:
1818
docker-run:
1919
docker run -p 3000:3000 hypemd-dev
2020

21-
distribute:
22-
@./marketing/distribute.sh $(SLUG)
21+
tweet:
22+
@./marketing/tweet.sh $(SLUG)
23+
24+
tweet-dry:
25+
@./marketing/tweet.sh --dry-run $(SLUG)

content/ai-authoring-workflow/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Learn how to combine AI coding assistants like Claude with Hype's build-time validation to write technical documentation faster while keeping every code example correct.
88
tags: tutorial, ai, authoring, workflow, claude, hype
9+
tweet: AI can write docs fast, but how do you trust the code examples? Combine Claude with Hype's build-time validation — every snippet is verified before publish.
910
</details>
1011

1112
AI assistants are transforming how we write code. But when it comes to technical documentation, there's a trust problem: AI can generate plausible-looking code examples that don't actually work. Hype solves this by validating everything at build time — making AI-generated content trustworthy through automated verification.

content/deploying-with-docker/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Deploy a Hype-powered blog site with Docker. Covers Dockerfile setup, Dokploy, Heroku, and generic VPS deployment with Docker Compose.
88
tags: tutorial, docker, deployment, blog, hype
9+
tweet: Deploy a Hype-powered blog with Docker — from Dockerfile to production. Covers Dokploy, Heroku, and Docker Compose setups.
910
</details>
1011

1112
Hype builds and serves your blog in a single binary. That makes it a natural fit for Docker — one container that builds your site from source and serves it, with no external web server required.

content/engineering-handbook/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Use Hype to build an internal engineering handbook that stays in sync with your codebase. Executable examples, automated validation, and single-source documentation for your team.
88
tags: tutorial, engineering, handbook, automation, hype
9+
tweet: Your engineering handbook is probably wrong. Not because it was written badly — the code just changed. Here's how to make docs a build artifact with Hype.
910
</details>
1011

1112
Every engineering team has internal documentation. Style guides, onboarding docs, architecture decision records, runbook procedures. And almost universally, that documentation is wrong. Not because someone wrote it badly, but because the code changed and nobody updated the docs.

content/getting-started/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Gopher Guides
77
seo_description: Learn how to install Hype, create your first dynamic Markdown document, and execute code blocks at build time.
88
tags: tutorial, getting-started, hype
9+
tweet: What if your Markdown could execute code and catch errors before you publish? Get started with Hype — dynamic Markdown for Go developers.
910
</details>
1011

1112
Hype is a content engine that makes Markdown dynamic. You can execute code, include files, and validate everything at build time. This guide walks you through installation and your first hype document.

content/release-notes-pipeline/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Build a release notes pipeline using Hype with executable code snippets, automated validation, and version-aware documentation that ships with every release.
88
tags: tutorial, release-notes, ci-cd, pipeline, hype
9+
tweet: Bad release notes erode trust. Build a pipeline where every code example compiles, every command runs, and every API ref is verified at build time.
910
</details>
1011

1112
Release notes are the first thing users read after updating. Bad release notes — outdated examples, broken migration commands, incorrect API signatures — erode trust and generate support tickets. Hype lets you build release notes where every code example compiles, every command runs, and every API reference reflects the actual release.

content/single-source-docs/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Learn how to use Hype to maintain a single Markdown source that generates both your GitHub README and website documentation, keeping them permanently in sync.
88
tags: tutorial, docs, workflow, hype
9+
tweet: Your README says one thing, your docs site says another. Write it once with Hype and generate both from a single source.
910
</details>
1011

1112
Every open source project has the same problem: documentation lives in too many places. Your README says one thing, your docs site says another, and the install instructions in your wiki are three versions behind. You end up maintaining the same content in multiple locations, and they inevitably drift apart.

content/training-materials/module.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ published: 03/15/2026
66
author: Cory LaNou
77
seo_description: Learn how to use Hype to build reusable training and course materials with executable code examples, file includes, and modular content that stays in sync with your codebase.
88
tags: tutorial, training, education, includes, hype
9+
tweet: Training materials go stale the moment code changes. Use Hype to build courses with executable examples that stay in sync with your codebase.
910
</details>
1011

1112
If you've ever written training materials for a programming course, you know the pain: code examples go stale, exercises drift out of sync with the slides, and updating one module means checking every other module that references it. Hype was built to solve exactly this problem.

0 commit comments

Comments
 (0)