From 7d773221e7711c4e534e89264c719b4cc5aabb1f Mon Sep 17 00:00:00 2001 From: Jefferson Julio Date: Wed, 2 Jun 2021 23:38:09 -0300 Subject: support for comments on pages --- config.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'config.sh') 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 -- cgit v1.2.3