Skip to content

Commit

Permalink
[BUGFIX] Sidebar nested file exclude, [FEATURE] .wikignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed Jan 15, 2022
1 parent dbec71a commit 1c2f272
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions sidebar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1c2f272

Please sign in to comment.