Files
boc/scripts/article-publisher.sh
T
Bernt aee0f09db8 landvex: Fixar och tester klara för alla komponenter
- Datafabrik: Dockerfile fix, agentorkestrering fungerar
- Vision: Identify-modell, FAISS, OCR alla testade
- API: Alla 7 integrationstester passerade
- Upplösare: Entitetsupplösning verifierad
2026-07-05 06:41:32 +00:00

92 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
# Landvex Article Publisher - Automation script
# Usage: ./article-publisher.sh <article-number> <slug> <title> <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>
<meta name="description" content="$DESCRIPTION">
<link rel="canonical" href="https://landvex.com/insights/$SLUG/">
<meta property="og:title" content="$TITLE | Landvex">
<meta property="og:description" content="$DESCRIPTION">
<meta property="og:type" content="article">
<meta property="og:url" content="https://landvex.com/insights/$SLUG/">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "$TITLE",
"description": "$DESCRIPTION",
"author": {"@type": "Organization", "name": "Landvex"},
"publisher": {"@type": "Organization", "name": "Landvex", "logo": {"@type": "ImageObject", "url": "https://landvex.com/apple-touch-icon.png"}},
"datePublished": "$DATE",
"dateModified": "$DATE",
"mainEntityOfPage": {"@type": "WebPage", "@id": "https://landvex.com/insights/$SLUG/"}
}
</script>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; line-height: 1.6; max-width: 760px; margin: 0 auto; padding: 40px 20px; color: #1a1a1a; }
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5em; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2em; margin-bottom: 0.5em; }
p { margin-bottom: 1.2em; }
.meta { color: #666; font-size: 0.9rem; margin-bottom: 2em; }
.cta { background: #f5f5f5; padding: 24px; border-radius: 8px; margin: 2em 0; }
.cta a { color: #0066cc; text-decoration: none; font-weight: 600; }
footer { margin-top: 4em; padding-top: 2em; border-top: 1px solid #eee; font-size: 0.85rem; color: #666; }
</style>
</head>
<body>
<article>
<h1>$TITLE</h1>
<p class="meta">Published $DATE · Decision Intelligence</p>
<p>[Article content goes here - add your content]</p>
<div class="cta">
<strong>What decision are you trying to make?</strong><br>
<a href="/enterprise/">Request a pilot →</a>
</div>
</article>
<footer>
<p><strong>Related:</strong> <a href="/methodology/">Our Methodology</a> · <a href="/insights/">All Insights</a></p>
</footer>
</body>
</html>
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"