site-neo/gensimap.sh

15 lines
628 B
Bash
Raw Normal View History

2023-02-10 14:02:43 -05:00
#!/bin/bash
# gensimap.sh: Generate a sitemap for my website.
# v2.0p1
2023-02-08 12:17:45 -05:00
function r { echo $@ >> out/sitemap.xml; }
test -d out/sitemap.xml && sed -i d sitemap.xml
2023-02-01 11:59:44 -05:00
r '<?xml version="1.0" encoding="UTF-8"?>'
2023-02-01 16:08:28 -05:00
r '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
2023-02-08 12:17:45 -05:00
for i in `find in -type f -name '*.html'`; do
2023-02-01 16:08:28 -05:00
r "<url>"
r "<loc>https://atlas48.neocities.org/$i</loc>"
r "<lastmod>$(date +"%Y-%M-%d" -r $i)</lastmod>"
2023-02-01 11:59:44 -05:00
r "</url>"
done
r "</urlset>"