blog

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit c1eafc3bde6985433926dc05656cb398d9ada9f6
parent 1b8292529a3ccf9c2b38ee5cbaecd2e27061b6cf
Author: Andrew Laack <andrew@laack.co>
Date:   Sat, 27 Sep 2025 23:33:34 -0500

Setup index

Diffstat:
Aposts/site/index.html | 15+++++++++++++++
Mscripts/convert.sh | 34++++++++++++++++++++++++----------
2 files changed, 39 insertions(+), 10 deletions(-)

diff --git a/posts/site/index.html b/posts/site/index.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset='UTF-8'> +<title>Andrew's Blog</title> +<link rel='stylesheet' href='style.css'> +</head> +<body> +<h1>Posts</h1> +<ol> +<li><a href='sustainability-of-youtube.html'>sustainability-of-youtube</a></li> +<li><a href='wikipedia-and-truth-on-the-internet.html'>wikipedia-and-truth-on-the-internet</a></li> +</ul> +</body> +</html> diff --git a/scripts/convert.sh b/scripts/convert.sh @@ -1,13 +1,27 @@ #!/bin/bash + rm posts/site/*.html -FILES=$(ls posts/entries) - -for FILE in $FILES -do - if [[ $FILE =~ \.md ]] ; then - echo $FILE - BASENAME="${FILE%.md}" - echo $BASENAME - pandoc posts/entries/$FILE -o posts/site/$BASENAME.html -s --css=style.css - fi + +INDEX_FILE="posts/site/index.html" +echo "<!DOCTYPE html> +<html> +<head> +<meta charset='UTF-8'> +<title>Andrew's Blog</title> +<link rel='stylesheet' href='style.css'> +</head> +<body> +<h1>Posts</h1> +<ol>" > "$INDEX_FILE" + +for FILE in posts/entries/*.md; do + [ -e "$FILE" ] || continue + BASENAME="$(basename "$FILE" .md)" + pandoc "$FILE" -o "posts/site/$BASENAME.html" -s --css=style.css + + echo "<li><a href='$BASENAME.html'>$BASENAME</a></li>" >> "$INDEX_FILE" done + +echo "</ul> +</body> +</html>" >> "$INDEX_FILE"