diff --git a/kewt.sh b/kewt.sh index 6f3b818..4c989fc 100755 --- a/kewt.sh +++ b/kewt.sh @@ -816,7 +816,12 @@ eval "find \"$src\" \( $IGNORE_ARGS \) -prune -o -type f -print" | sort | while is_preserved=1 fi - if [ "$single_file_index" = "true" ] && [ "${file%.md}" != "$file" ] && [ "$is_preserved" -eq 0 ] && [ ! -f "$(dirname "$file")/index.md" ]; then + is_posts_dir_2="false" + if [ -n "$posts_dir" ] && { [ "$dir_rel" = "$posts_dir" ] || [ "./$dir_rel" = "$posts_dir" ]; }; then + is_posts_dir_2="true" + fi + + if [ "$single_file_index" = "true" ] && [ "${file%.md}" != "$file" ] && [ "$is_preserved" -eq 0 ] && [ ! -f "$(dirname "$file")/index.md" ] && [ "$is_posts_dir_2" = "false" ]; then md_count=$(find "$(dirname "$file")" ! -name "$(basename "$(dirname "$file")")" -prune -name "*.md" | wc -l) [ "$md_count" -eq 1 ] && continue fi diff --git a/tools/build-standalone.sh b/tools/build-standalone.sh index b5ebf31..5e0b65c 100755 --- a/tools/build-standalone.sh +++ b/tools/build-standalone.sh @@ -26,7 +26,7 @@ exit $? #==PAYLOAD== EOF -VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "standalone") +VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "standalone") tmpbuild=$(mktemp -d) cp -r "$REPO_ROOT/kewt.sh" "$REPO_ROOT/markdown.sh" "$REPO_ROOT/awk" "$REPO_ROOT/styles" "$tmpbuild/" sed -e "s/kewt version git/kewt version $VERSION/" "$tmpbuild/kewt.sh" > "$tmpbuild/kewt.sh.tmp" && mv "$tmpbuild/kewt.sh.tmp" "$tmpbuild/kewt.sh"