From 1c2f272a66f2dbac4192de6760034d1f534d9af6 Mon Sep 17 00:00:00 2001 From: Inesh Bose <2504266b@student.gla.ac.uk> Date: Sat, 15 Jan 2022 16:59:25 +0000 Subject: [PATCH] [BUGFIX] Sidebar nested file exclude, [FEATURE] .wikignore --- publish.sh | 1 + sidebar.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/publish.sh b/publish.sh index 7550a5a..4a70675 100755 --- a/publish.sh +++ b/publish.sh @@ -16,6 +16,7 @@ cd "$WIKI_DIR" git config --local user.email "$(git log -1 --format='%ae')" git config --local user.name "$(git log -1 --format='%an')" +test -e .wikignore && cat .wikignore >> .gitignore if [ -n "$WIKI_IGNORE" ]; then for file in $WIKI_IGNORE; do echo "$file" >> .gitignore diff --git a/sidebar.sh b/sidebar.sh index a4d5f66..35f0f6c 100755 --- a/sidebar.sh +++ b/sidebar.sh @@ -8,6 +8,7 @@ IGNORE_FILE="../temp_wiki_excluded_$GITHUB_SHA.txt" echo "_Footer.md" >> $IGNORE_FILE echo "_Sidebar.md" >> $IGNORE_FILE +test -e .wikignore && IGNORE="$IGNORE $(cat .wikignore | tr '\r\n' ' ')" if [ -n "$IGNORE" ]; then for file in $IGNORE; do @@ -26,8 +27,8 @@ for f in *; do name="${f#*/}" echo "* ${name^}" >> _Sidebar.md for file in $f/*; do - if grep -q -x "$f" "$IGNORE_FILE"; then - echo "Exclude $f" + if grep -q -x "$file" "$IGNORE_FILE"; then + echo "Exclude $file" continue fi echo " * [$(basename $file | sed 's/\.[^.]*$//')]($(basename $file | sed 's/\.[^.]*$//'))" >> _Sidebar.md