Files: 4cec02dce5f236dd7abfe422e36df095820db31c / feed.sh
941 bytesRaw
1 | |
2 | |
3 | : ${SITE_URL:=./} |
4 | : ${SITE_TITLE:=My Cool Site} |
5 | : ${SITE_AUTHOR:=$(grep $(id -u) /etc/passwd | cut -d: -f 5 | cut -d, -f1)} |
6 | : ${SITE_ID:=$(cat site_id || echo urn:uuid:$(uuidgen) | tee site_id)} |
7 | : ${FEED_ENTRIES:=15} |
8 | : ${FEED_WIDTH:=80} |
9 | |
10 | cat <<EOF |
11 | <?xml version="1.0" encoding="utf-8"?> |
12 | <feed xmlns="http://www.w3.org/2005/Atom"> |
13 | <title>$SITE_TITLE</title> |
14 | <link rel="alternate" type="text/html" href="$SITE_URL"/> |
15 | <link rel="self" type="application/rss+xml" href="${SITE_URL}feed.xml"/> |
16 | <updated>$(date --iso-8601=seconds | sed 's/..$/:&/')</updated> |
17 | <author> |
18 | <name>$SITE_AUTHOR</name> |
19 | </author> |
20 | <id>$SITE_ID</id> |
21 | |
22 | EOF |
23 | |
24 | content_delim=$(uuidgen) |
25 | |
26 | git log -$FEED_ENTRIES --stat=$FEED_WIDTH --format=format:"entry $content_delim |
27 | title %s |
28 | id %H |
29 | name %aN |
30 | email %aE |
31 | updated %ai |
32 | content $content_delim |
33 | commit %H |
34 | |
35 | %B |
36 | stat $content_delim" | awk -f xml.awk -v site="$SITE_URL" |
37 | |
38 | cat <<EOF |
39 | </feed> |
40 | |
41 | EOF |
42 |
Built with git-ssb-web