Skip to content

Commit 2671340

Browse files
authored
Merge pull request #15 from gopherguides/feat/4-distribution-pipeline
feat(marketing): add automated blog-to-X tweet pipeline
2 parents e6d79cc + bcf0020 commit 2671340

14 files changed

Lines changed: 311 additions & 3 deletions

File tree

.github/workflows/tweet.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: 0
17+
18+
- name: Find new blog posts
19+
id: changed
20+
run: |
21+
changed=$(git diff --name-only --diff-filter=A ${{ github.event.before }}..${{ github.sha }} -- '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 new 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+
if [[ ! -f "$file" ]]; then
37+
echo "Skipping $file — file does not exist"
38+
continue
39+
fi
40+
slug=$(basename "$(dirname "$file")")
41+
tweet_field=$(awk '/<details>/{f=1;next} /<\/details>/{if(f)exit} f' "$file" | grep '^tweet:' | head -1)
42+
if [[ -z "$tweet_field" ]]; then
43+
echo "Skipping $slug — no tweet field"
44+
continue
45+
fi
46+
echo "Tweeting for: $slug"
47+
./marketing/tweet.sh "$slug"
48+
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

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM golang:1.25 AS builder
2-
RUN go install github.com/gopherguides/hype/cmd/hype@main
2+
RUN go install github.com/gopherguides/hype/cmd/hype@v0.8.0
33

44
FROM golang:1.25
55
COPY --from=builder /go/bin/hype /usr/local/bin/hype

Makefile

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

33
build:
44
hype blog build
@@ -17,3 +17,9 @@ docker-build:
1717

1818
docker-run:
1919
docker run -p 3000:3000 hypemd-dev
20+
21+
tweet:
22+
@./marketing/tweet.sh $(SLUG)
23+
24+
tweet-dry:
25+
@./marketing/tweet.sh --dry-run $(SLUG)

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ baseURL: "https://hypemd.dev"
44
author:
55
name: "Gopher Guides"
66
email: ""
7-
twitter: ""
7+
twitter: "@hype_markdown"
88
theme: "developer"
99
highlight:
1010
style: "monokai"

content/ai-authoring-workflow/module.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
slug: ai-authoring-workflow
55
published: 03/15/2026
66
author: Cory LaNou
7+
author_twitter: @corylanou
78
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.
89
tags: tutorial, ai, authoring, workflow, claude, hype
10+
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.
911
</details>
1012

1113
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
slug: deploying-with-docker
55
published: 03/15/2026
66
author: Cory LaNou
7+
author_twitter: @corylanou
78
seo_description: Deploy a Hype-powered blog site with Docker. Covers Dockerfile setup, Dokploy, Heroku, and generic VPS deployment with Docker Compose.
89
tags: tutorial, docker, deployment, blog, hype
10+
tweet: Deploy a Hype-powered blog with Docker — from Dockerfile to production. Covers Dokploy, Heroku, and Docker Compose setups.
911
</details>
1012

1113
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
slug: engineering-handbook
55
published: 03/15/2026
66
author: Cory LaNou
7+
author_twitter: @corylanou
78
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.
89
tags: tutorial, engineering, handbook, automation, hype
10+
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.
911
</details>
1012

1113
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
slug: getting-started
55
published: 03/15/2026
66
author: Gopher Guides
7+
author_twitter: @hype_markdown
78
seo_description: Learn how to install Hype, create your first dynamic Markdown document, and execute code blocks at build time.
89
tags: tutorial, getting-started, hype
10+
tweet: What if your Markdown could execute code and catch errors before you publish? Get started with Hype — dynamic Markdown for Go developers.
911
</details>
1012

1113
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
slug: release-notes-pipeline
55
published: 03/15/2026
66
author: Cory LaNou
7+
author_twitter: @corylanou
78
seo_description: Build a release notes pipeline using Hype with executable code snippets, automated validation, and version-aware documentation that ships with every release.
89
tags: tutorial, release-notes, ci-cd, pipeline, hype
10+
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.
911
</details>
1012

1113
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.

0 commit comments

Comments
 (0)