From 40518ec0c560df661051a0e69c356b5ebe72e8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sun, 18 Feb 2024 10:55:25 +0100 Subject: [PATCH] _sitemap: Try using Zsh's glob to find the files. --- qsgen2 | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/qsgen2 b/qsgen2 index 0a8507f..ac82b17 100755 --- a/qsgen2 +++ b/qsgen2 @@ -1,14 +1,20 @@ #!/usr/bin/zsh -# -# Quick Site Generator 2 is a static website generator inspired by Nikola. -# It is written for the Z shell (zsh) because that's what I use and also because I like it better than Bash. +############################################################################### +############################################################################### # -# This script is an almost complete rewrite of my old script because it became overly complicated and -# had way too many bugs, even though it worked on simple sites. +# Quick Site Generator 2 is a static website generator inspired by Nikola. +# It is written for the Z shell (zsh) because that's what I use and also because +# I like it better than Bash. +# +# This script is an almost complete rewrite of my old script because it became +# overly complicated and had way too many bugs, even though it worked on simple +# sites. # # https://github.com/kekePower/qsgen2/ # +############################################################################### +############################################################################### VERSION="0.4.0" # Thu-2024-02-15 QSGEN="Quick Site Generator 2" @@ -915,7 +921,8 @@ function _sitemap() { #local sitemap_page="${www_root}/sitemap-pages.xml" # 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=("${(@f)$(find "${www_root}" -type f -name "*.html")}") + local -a html_files=("${www_root}/**/[a-z]*.html(.)") # Working on provinding 2 sitemaps, 1 for pages and 1 for blogs. # sitemap-pages.xml # sitemap-blogs.xml @@ -1236,4 +1243,4 @@ function _zhtml() { _blogs _pages -_sitemap \ No newline at end of file +_sitemap