#!/bin/bash # Landvex Article Publisher - Automation script # Usage: ./article-publisher.sh <description> <date> S3_BUCKET="s3://landvex-prod" CF_DIST_ID="E2M3J95HLUR89H" ARTICLE_NUM=$1 SLUG=$2 TITLE=$3 DESCRIPTION=$4 DATE=$5 if [ -z "$ARTICLE_NUM" ] || [ -z "$SLUG" ] || [ -z "$TITLE" ]; then echo "Usage: $0 <article-number> <slug> <title> <description> <date>" echo "Example: $0 15 \"new-article\" \"My New Article\" \"Description here\" \"2026-08-24\"" exit 1 fi # Create directory mkdir -p "/tmp/insights/$SLUG" # Generate HTML cat > "/tmp/insights/$SLUG/index.html" << EOF <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>$TITLE | Landvex

$TITLE

Published $DATE · Decision Intelligence

[Article content goes here - add your content]

What decision are you trying to make?
Request a pilot →
EOF # Upload to S3 aws s3 cp "/tmp/insights/$SLUG/index.html" "$S3_BUCKET/insights/$SLUG/index.html" --content-type "text/html" --cache-control "max-age=3600" # Invalidate CloudFront aws cloudfront create-invalidation --distribution-id "$CF_DIST_ID" --paths "/insights/$SLUG/*" --query 'Invalidation.Id' --output text echo "✅ Article $ARTICLE_NUM published: /insights/$SLUG/" echo " Title: $TITLE" echo " Date: $DATE"