aboutsummaryrefslogtreecommitdiff
path: root/config.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config.sh')
-rwxr-xr-xconfig.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/config.sh b/config.sh
index ebc5027..b29dda0 100755
--- a/config.sh
+++ b/config.sh
@@ -1,22 +1,29 @@
#!/bin/bash
+# Enable looping through folders and subfolders
+shopt -s globstar
+
# All relatives paths must end with slash and must not be start by dot and/or slash
# Examplo
# VAR_PATH=dir/subdir/
# Folder where posts are stored, must be relative and suffed by a slash
-ARTICLES_PATH=artigos/
+export ARTICLES_PATH=artigos/
# Supported article file extensions, must be separated by vertical bar
# Exemple
# ARTICLES_EXTS="txt|html|md"
-ARTICLES_EXTS="txt|html|md"
+export ARTICLES_EXTS="txt|html|md"
# Pages, excluding the index "/""
-PAGES=(
+export PAGES=(
"/contato"
)
-ALLOWED_POST_FOLDERS=(
+export ALLOWED_POST_FOLDERS=(
"/contato/comments"
)
+
+for article in "./$ARTICLES_PATH"**/*; do
+ ALLOWED_POST_FOLDERS+=("${article/./}/comments")
+done