#!/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 export ARTICLES_PATH=artigos/ # Supported article file extensions, must be separated by vertical bar # Exemple # ARTICLES_EXTS="txt|html|md" export ARTICLES_EXTS="txt|html|md" # Pages, excluding the index "/"" export PAGES=( "/contato" ) export ALLOWED_POST_FOLDERS=( "/contato/comments" ) for article in "./$ARTICLES_PATH"**/*; do ALLOWED_POST_FOLDERS+=("${article/./}/comments") done