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
This commit is contained in:
Bernt
2026-07-05 06:41:32 +00:00
parent f4f853d94b
commit aee0f09db8
19583 changed files with 1450867 additions and 1153 deletions
+91
View File
@@ -0,0 +1,91 @@
#!/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"
+70
View File
@@ -0,0 +1,70 @@
#!/bin/bash
# Uppdatera /insights/index.html med alla publicerade artiklar
S3_BUCKET="s3://landvex-prod"
CF_DIST_ID="E2M3J95HLUR89H"
# Hämta lista över alla artiklar från S3
echo "Hämtar artiklar från S3..."
aws s3 ls $S3_BUCKET/insights/ | grep "PRE" | awk '{print $2}' | sed 's|/||' > /tmp/article-slugs.txt
# Generera HTML för varje artikel
echo "Genererar insights-index..."
ARTICLES_HTML=""
while read slug; do
if [ "$slug" != "" ] && [ "$slug" != "index.html" ]; then
# Hämta titel från artikeln
TITLE=$(curl -s "https://landvex.com/insights/$slug/" | grep -o '<title>.*</title>' | sed 's/<title>//;s/<\/title>//;s/ | Landvex//' | head -1)
if [ -z "$TITLE" ]; then
TITLE="$slug"
fi
ARTICLES_HTML="$ARTICLES_HTML
<div class=\"article-card\">
<h2><a href=\"/insights/$slug/\">$TITLE</a></h2>
</div>"
fi
done < /tmp/article-slugs.txt
# Skapa komplett HTML
cat > /tmp/insights-index.html << HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intelligence Insights | Landvex Blog</title>
<meta name="description" content="Research and analysis on decision intelligence, field data quality and the gap between official data and observed reality.">
<link rel="canonical" href="https://landvex.com/insights/">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; line-height: 1.6; max-width: 1200px; margin: 0 auto; padding: 40px 20px; color: #1a1a1a; }
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5em; }
.subtitle { color: #666; font-size: 1.2rem; margin-bottom: 3em; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2em; }
.article-card { border: 1px solid #eee; border-radius: 8px; padding: 24px; transition: box-shadow 0.2s; }
.article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.article-card h2 { font-size: 1.3rem; margin-top: 0; }
.article-card a { color: #1a1a1a; text-decoration: none; }
.article-card a:hover { color: #0066cc; }
</style>
</head>
<body>
<h1>Intelligence Insights</h1>
<p class="subtitle">Research and analysis on decision intelligence, field data quality and the gap between official data and observed reality.</p>
<div class="article-grid">
$ARTICLES_HTML
</div>
</body>
</html>
HTML
# Upload
aws s3 cp /tmp/insights-index.html $S3_BUCKET/insights/index.html --content-type "text/html" --cache-control "max-age=3600"
# Invalidate
aws cloudfront create-invalidation --distribution-id "$CF_DIST_ID" --paths "/insights/" --query 'Invalidation.Id' --output text
echo "✅ Insights index uppdaterad"