summaryrefslogtreecommitdiff
path: root/util/sitemap.sh
diff options
context:
space:
mode:
authorDavid Oberhollenzer <goliath@infraroot.at>2020-03-17 16:10:23 +0100
committerDavid Oberhollenzer <goliath@infraroot.at>2020-06-28 17:18:45 +0200
commitbb34d2b128ebc1b95f7cbd40876689707eb1e1e0 (patch)
tree2262dd6c1332e5526700ecb8e138daca8a1c7bd3 /util/sitemap.sh
Initial commit
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'util/sitemap.sh')
-rwxr-xr-xutil/sitemap.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/sitemap.sh b/util/sitemap.sh
new file mode 100755
index 0000000..643ed44
--- /dev/null
+++ b/util/sitemap.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+url="${1%/}"
+mdpath="$2"
+htmlpath="${3#/}"
+
+date=$(git log -1 --format=%cs "$mdpath")
+
+cat <<_EOF
+<url>
+<loc>$(echo $url/$htmlpath)</loc>
+<lastmod>$date</lastmod>
+</url>
+_EOF