From 8159f090884708c1cd6209a2effacc854dfef45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Mon, 19 Feb 2024 19:27:37 +0100 Subject: [PATCH] _sitemap: Let's find files from www_root directly and map them from there. --- qsgen2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qsgen2 b/qsgen2 index b8758b7..9a781cd 100755 --- a/qsgen2 +++ b/qsgen2 @@ -941,14 +941,15 @@ function _sitemap() { # Find all HTML files and store them in an array # local -a html_files=("${(@f)$(find "${www_root}" -type f -name "*.html")}") - local -a html_files=(${www_root}/**/[a-z]*.html(.)) - local -a blog_files=(${html_files[@]:#*blog/2*}) + builtin cd ${config[site_root]} + local -a html_files=(**/[a-z]*.html(.)) + local -a blog_files=(${html_files[@]:#*blog*}) local -a page_files=() for file in "${html_files[@]}"; do - [[ $file != *blog/2* ]] && blog_files+=("$file") + [[ $file != *blog* ]] && page_files+=("$file") done - local -a xml_files=(${www_root}/[a-z]*.xml(.)) + local -a xml_files=([a-z]*.xml(.)) for file in "${xml_files[@]}"; do [[ $file != *sitemap.xml* ]] && xml_files+=("$file") done @@ -1043,6 +1044,7 @@ function _sitemap() { if (${debug}); then _msg debug "${0:t}_msg_2" " ${sitemap_file}"; fi fi + builtin cd ${config[project_root]} }