make-web/src/index.ps
2023-10-24 08:08:46 +02:00

41 lines
538 B
PostScript

#!/bin/ksh
# chdir to working directory
cd src/posts
cat <<'EOF'
<h1>
Welcome!
</h1>
<p>
Welcome to my little place on the web. It may not been the pretties
you've seen today, but it's all self made.
</p>
<h2>
Posts
</h2>
<ul>
EOF
# print list
ls -r1 | while read line
do
TITLE="$(echo "${line%%.*}" | tr '_' ' ')"
URI="posts/${line%%.*}.html"
cat <<EOF
<li>
<a href="$URI">
$TITLE
</a>
</li>
EOF
done
cat <<EOF
</ul>
EOF