add pdf download links to index page

This commit is contained in:
2025-12-30 10:09:51 +01:00
parent f13eeec381
commit 685d3c154c

View File

@@ -22,19 +22,36 @@ cat > "$BUILD_DIR/index.html" << 'HEADER'
}
h1 { color: #fff; margin-bottom: 0.5rem; }
.subtitle { color: #888; margin-bottom: 2rem; }
.termin-row {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
.termin {
background: #16213e;
border-radius: 8px;
padding: 1.5rem;
margin-bottom: 1rem;
text-decoration: none;
display: block;
flex: 1;
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; }
.pdf {
background: #e94560;
color: #fff;
padding: 0.5rem 1rem;
border-radius: 4px;
text-decoration: none;
font-size: 0.85rem;
font-weight: 500;
transition: background 0.2s;
}
.pdf:hover { background: #ff6b6b; }
footer { margin-top: 2rem; color: #666; font-size: 0.85rem; text-align: center; }
footer a { color: #4ecca3; }
</style>
@@ -66,13 +83,23 @@ for html in $(ls "$BUILD_DIR"/2*.html 2>/dev/null | sort); do
fi
termin_label="Termin $termin_num"
pdf_filename="${filename%.html}.pdf"
# Check if PDF exists
pdf_link=""
if [[ -f "$BUILD_DIR/$pdf_filename" ]]; then
pdf_link="<a href=\"$pdf_filename\" class=\"pdf\">PDF</a>"
fi
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>
<div class="termin-row">
<a href="$filename" class="termin">
<h2>$termin_label</h2>
<span class="date">$formatted_date</span>
<span class="topic">$topic</span>
</a>
$pdf_link
</div>
LINK
done