summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-08-26 22:35:57 +0300
committerPaul Buetow <paul@buetow.org>2024-08-26 22:35:57 +0300
commitc9ad34c95dd69ea423622b730e2b4a121f0003ea (patch)
treee922ae5861565c2448be10bfc16b9b29a4981792
parent82c2dce967453a0c3da56ec5cdd6697c6fbcac33 (diff)
fix
-rw-r--r--lib/template.source.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/template.source.sh b/lib/template.source.sh
index 626aed0..acbc9e3 100644
--- a/lib/template.source.sh
+++ b/lib/template.source.sh
@@ -75,7 +75,7 @@ template::_line () {
# Sugesting adding a ToC when there are many sections
template::suggester::toc () {
find "$CONTENT_BASE_DIR/gemtext" -name \*.gmi | while read -r gmi_file; do
- if $GREP -q '<< template::inline::toc' "$gmi_file"; then
+ if test -f "$gmi_file.tpl" && $GREP -q '<< template::inline::toc' "$gmi_file.tpl"; then
continue # Has alread a ToC
fi
local -i num_sections="$($SED -E -n '/^```/,/^```/! { /^#+ /p; }' "$gmi_file" | wc -l)"