diff options
Diffstat (limited to 'config.sh')
-rwxr-xr-x | config.sh | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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 |