From 4f1da40b3f199452ad96942a44bb8ee23eae80eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 16:54:36 +0100 Subject: [PATCH] Updated _generate_sitemap --- qsgen2 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/qsgen2 b/qsgen2 index 20e9c67..f7ed880 100755 --- a/qsgen2 +++ b/qsgen2 @@ -615,13 +615,13 @@ function _generate_sitemap() { local -a html_files=("${(@f)$(find "${www_root}" -type f -name "*.html")}") # Start of the XML file - echo '' > "${sitemap_file}" - echo "\<\?xml-stylesheet type=\"text/xsl\" href="\${site_url}/css/default-sitemap.xsl\?sitemap=page\"\?\>" >> "${sitemap_file}" - echo '> "${sitemap_file}" - echo ' xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' >> "${sitemap_file}" - echo ' xmlns:xhtml="http://www.w3.org/1999/xhtml"' >> "${sitemap_file}" - echo ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"' >> "${sitemap_file}" - echo '>' >> "${sitemap_file}" + echo '' > ${sitemap_file} + echo "\<\?xml-stylesheet type=\"text/xsl\" href="\${site_url}/css/default-sitemap.xsl\?sitemap=page\"\?\>" >> ${sitemap_file} + echo '> ${sitemap_file} + echo ' xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' >> ${sitemap_file} + echo ' xmlns:xhtml="http://www.w3.org/1999/xhtml"' >> ${sitemap_file} + echo ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"' >> ${sitemap_file} + echo '>' >> ${sitemap_file} # Add each URL to the sitemap for file in "${html_files[@]}"; do @@ -629,12 +629,12 @@ function _generate_sitemap() { local url="${site_url}${file#$www_root}" local lastmod=$(stat -c %y "${file}" 2>/dev/null | cut -d' ' -f1,2 | sed 's/ /T/' | sed 's/\..*$//') - echo " " >> "${sitemap_file}" - echo " ${url}" >> "${sitemap_file}" - echo " " >> "${sitemap_file}" - echo " " >> "${sitemap_file}" - echo " " >> "${sitemap_file}" - echo " " >> "${sitemap_file}" + echo " " >> ${sitemap_file} + echo " ${url}" >> ${sitemap_file} + echo " " >> ${sitemap_file} + echo " " >> ${sitemap_file} + echo " " >> ${sitemap_file} + echo " " >> ${sitemap_file} done # End of the XML file