%%% gem_header 20 'text/gemini; charset=utf-8' cd serve echo -e '# Sitemap\n' set tree (tree -I (string join -- '' '*~|#*#|.#*' '|'$sitemap_hidden_paths) -f -i --dirsfirst) for line in $tree[1..-3] set line (string trim -l -c . $line) set -l depth (math (count (string split / $line)) - 1) set -l display (string split / $line)[-1] if not string match -q -e . $display set display $display/ set line $line/ end echo '=>' $line (string repeat -n $depth -- '| ')$display end string sub $tree[-2..-1] %%%