blob: 1be1d83f57f1604f73092c4fc46faff6524b0d40 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#!./page.sh
cat << EOF
<div class="grid">
<div class="about">
<p>Hi, I'm david and this is my website.</p>
<p>if you want to contact me, you can message me on matrix <code>@ix:davidovski.xyz</code>.</p>
</div>
<div class="image">
<img src="/images/remotecontrol.gif">
</div>
</div>
EOF
cat << EOF
<div>
<h2>blog posts</h2>
<ul>
EOF
# list all the files in the directory
for file in $(ls -t entries/*.html); do
title="$(grep '^# ' $file)"
title=${title#\# }
printf "
<li class=\"entry\">
<a href=\"%s\">
<span>%s</span>
<div class=\"small\">%s</div>
</a>
</li>
" "${file%.*}.html" "$title" "$(git log --pretty=format:'%cD' --follow -- "$file" | tail -n 1)"
done
cat << EOF
</ul>
</div>
EOF
|