aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTino Reichardt2017-01-06 15:21:19 +0100
committerTino Reichardt2017-01-06 15:21:19 +0100
commitcd07cc017cf7e60808a5c42da64492d57e8bd789 (patch)
tree96cea67f8b782c84e9ec0f3127c5a981af61300e
parentdc83a4b9e15299854ec635951f4170c379c99daa (diff)
downloademil-sitemap-generator-cd07cc017cf7e60808a5c42da64492d57e8bd789.tar.xz
emil-sitemap-generator-cd07cc017cf7e60808a5c42da64492d57e8bd789.tar.zst
added FREQ variable
-rwxr-xr-xsitemap.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/sitemap.sh b/sitemap.sh
index 2782b40..56c33a2 100755
--- a/sitemap.sh
+++ b/sitemap.sh
@@ -3,6 +3,9 @@
# url configuration
URL="https://mcmilk.de/"
+# values: always hourly daily weekly monthly yearly never
+FREQ="weekly"
+
# begin new sitemap
exec 1> sitemap.xml
@@ -13,16 +16,14 @@ echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
# print urls
IFS=$'\r\n' GLOBIGNORE='*' command eval "OPTIONS=($(cat $0.options))"
-find . -type f "${OPTIONS[@]}" -printf "%TY-%Tm-%Td %TH:%TM %p\n" | \
+find . -type f "${OPTIONS[@]}" -printf "%TY-%Tm-%Td%p\n" | \
while read -r line; do
- # TIME is ignored...
DATE=${line:0:10}
- TIME=${line:11:5}
- FILE=${line:19}
+ FILE=${line:12}
echo "<url>"
echo " <loc>${URL}${FILE}</loc>"
- echo " <lastmod>${DATE}</lastmod>"
- echo " <changefreq>weekly</changefreq>"
+ echo " <lastmod>$DATE</lastmod>"
+ echo " <changefreq>$FREQ</changefreq>"
echo "</url>"
done