From 166157fc779971353c08e38834b1ba2ed613f889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sun, 11 Feb 2024 11:11:24 +0100 Subject: [PATCH] Spaces and tabs --- qsgen2 | 76 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/qsgen2 b/qsgen2 index 1870f09..c19dadc 100755 --- a/qsgen2 +++ b/qsgen2 @@ -796,12 +796,12 @@ function _blogs() { export new_updated_blogs=false fi -if [[ ${new_updated_blogs} == "true" ]]; then - if (${debug}) _msg sub "* _blogs: Running _blog_idx_for_index" - _blog_idx_for_index - if (${debug}) _msg sub "* _blogs: Running _blog_index" - _blog_index -fi + if [[ ${new_updated_blogs} == "true" ]]; then + if (${debug}) _msg sub "* _blogs: Running _blog_idx_for_index" + _blog_idx_for_index + if (${debug}) _msg sub "* _blogs: Running _blog_index" + _blog_index + fi } @@ -939,47 +939,47 @@ function _sitemap() { local debug=false fi -# Check if sitemap is set to true and if there are updated Blogs or Pages before updating the sitemap.xml file. -if [[ ${sitemap} == "true" ]] && ( [[ ${new_updated_blogs} == "true" ]] || [[ ${new_updated_pages} == "true" ]] ); then + # Check if sitemap is set to true and if there are updated Blogs or Pages before updating the sitemap.xml file. + if [[ ${sitemap} == "true" ]] && ( [[ ${new_updated_blogs} == "true" ]] || [[ ${new_updated_pages} == "true" ]] ); then - _msg main "Generating Sitemap" + _msg main "Generating Sitemap" - local sitemap_file="${www_root}/sitemap.xml" + local sitemap_file="${www_root}/sitemap.xml" - # Find all HTML files and store them in an array - local -a html_files=("${(@f)$(find "${www_root}" -type f -name "*.html")}") + # Find all HTML files and store them in an array + local -a html_files=("${(@f)$(find "${www_root}" -type f -name "*.html")}") - # Start of the XML file - echo '' > ${sitemap_file} - echo "" >> ${sitemap_file} - echo "" >> ${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} + # Start of the XML file + echo '' > ${sitemap_file} + echo "" >> ${sitemap_file} + echo "" >> ${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 - # Remove www_root from the path and prepend site_url - 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/\..*$//') + # Add each URL to the sitemap + for file in "${html_files[@]}" + do + # Remove www_root from the path and prepend site_url + 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} - done + 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 - echo '' >> "${sitemap_file}" + # End of the XML file + echo '' >> "${sitemap_file}" - if (${debug}); then _msg debug "Sitemap generated at ${sitemap_file}"; fi + if (${debug}); then _msg debug "Sitemap generated at ${sitemap_file}"; fi -fi + fi }