Summary Files Commits Branches @commit @diff @stats
path: root / meta / meta.awk
blob: e439fc45a02a9c282e48214a50d72cbb3caf8568 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
BEGIN {
	sitemap = ENVIRON["DST"] "/sitemap.xml"
	print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ORS \
	      "<urlset" ORS \
	      "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" ORS \
	      "xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9" ORS \
	      "http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\"" ORS \
	      "xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">" > sitemap

	for (i = ARGC; i > 0; --i) {
		if (!ARGV[i]) continue

		#-- Add to sitemap --#
		print "<url><loc>" ENVIRON["URL"] substr(ARGV[i], length(ENVIRON["DST"]) + 1) "</loc><lastmod>" date "</lastmod><priority>1.0</priority></url>" > sitemap
	}

	print "</urlset>" > sitemap
}