add makefile improvements and index generator

- add deploy-html, optimize-images, copy-assets targets
- add scripts/generate-index.sh for slide overview
- integrate index generation into html/build targets
- deploy to 223015c path

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-19 17:05:38 +01:00
co-authored by Claude Opus 4.5
parent 75c28fba58
commit fa888ede32
3 changed files with 153 additions and 41 deletions
+88
View File
@@ -0,0 +1,88 @@
#!/usr/bin/env bash
# Generate index.html for slide overview
BUILD_DIR="${1:-build}"
cat > "$BUILD_DIR/index.html" << 'HEADER'
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>223015c - Internettechnologien</title>
<style>
* { box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background: #1a1a2e;
color: #eee;
}
h1 { color: #fff; margin-bottom: 0.5rem; }
.subtitle { color: #888; margin-bottom: 2rem; }
.termin {
background: #16213e;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
text-decoration: none;
display: block;
transition: transform 0.2s, background 0.2s;
}
.termin:hover { background: #1f4068; transform: translateX(5px); }
.termin h2 { color: #fff; margin: 0 0 0.5rem 0; font-size: 1.2rem; }
.termin .date { color: #4ecca3; font-size: 0.9rem; }
.termin .topic { color: #aaa; font-size: 0.95rem; margin-left: 1rem; }
footer { margin-top: 2rem; color: #666; font-size: 0.85rem; text-align: center; }
footer a { color: #4ecca3; }
</style>
</head>
<body>
<h1>223015c</h1>
<p class="subtitle">Internettechnologien<br>
HdM Stuttgart - WS 2025/26 - Michael Czechowski</p>
HEADER
# Generate links for each termin (sorted)
for html in $(ls "$BUILD_DIR"/2*.html 2>/dev/null | sort); do
filename=$(basename "$html")
# Extract components from filename
# Format: 2025-12-20-termin-1-geschichte-grundlagen-html.html
date=$(echo "$filename" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}')
termin_num=$(echo "$filename" | grep -oE 'termin-[0-9]+' | grep -oE '[0-9]+')
topic_raw=$(echo "$filename" | sed -E 's/^[0-9]{4}-[0-9]{2}-[0-9]{2}-termin-[0-9]+-//' | sed 's/\.html$//')
# Format topic: replace - with space, capitalize
topic=$(echo "$topic_raw" | sed 's/-/ /g' | sed 's/.*/\u&/')
# Format date
if [[ "$date" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then
formatted_date=$(date -d "$date" "+%d.%m.%Y" 2>/dev/null || echo "$date")
else
formatted_date="TBA"
fi
termin_label="Termin $termin_num"
cat >> "$BUILD_DIR/index.html" << LINK
<a href="$filename" class="termin">
<h2>$termin_label</h2>
<span class="date">$formatted_date</span>
<span class="topic">$topic</span>
</a>
LINK
done
cat >> "$BUILD_DIR/index.html" << 'FOOTER'
<footer>
<a href="https://git.librete.ch/hdm/223015c">Git Repository</a> -
<a href="mailto:mail@librete.ch">Kontakt</a>
</footer>
</body>
</html>
FOOTER
echo "Generated $BUILD_DIR/index.html"