summaryrefslogtreecommitdiff
path: root/site/rss.xml
blob: 65b3ba73eac179255792ebf11743b799a040b913 (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
#!/bin/sh

cat << EOF
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>davidovski</title>
  <link>https://davidovski.xyz</link>
  <description>davidovski's site</description>
EOF

for entry in entries/*.html; do
    title="$(grep '^# ' $entry)"
    title=${title#\# }

    printf "<item>\n"
    printf "<title>%s</title>\n" "${title}"
    printf "<link>%s</link>\n" "http://davidovski.xyz/$entry"
	printf "<pubDate>%s</pubDate>\n" "$(git log --pretty=format:'%cD' --follow -- "$entry" | tail -n 1)"


    printf "<description><![CDATA["
    md2html $entry
    printf "]]></description>\n</item>"

  done


cat << EOF
</channel>
</rss>
EOF