Skip to content

Commit 249c857

Browse files
blogcompany0-ctoPaperclip-Paperclip
andcommitted
fix(ci): validate-images.sh content directory path and glob pattern
- Change default path from content/posts to content/post - Update glob to match Hugo page bundle structure (*/index.md) Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent 3f96cb6 commit 249c857

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/validate-images.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
# validate-images.sh — 블로그 포스트 이미지 최소 개수 검증
33
# 사용: ./scripts/validate-images.sh [content_dir] [min_images]
4-
# 기본값: content/posts 3
4+
# 기본값: content/post 3
55

66
set -euo pipefail
77

8-
CONTENT_DIR="${1:-content/posts}"
8+
CONTENT_DIR="${1:-content/post}"
99
MIN_IMAGES="${2:-3}"
1010
FAILED=0
1111
CHECKED=0
@@ -20,13 +20,14 @@ echo "=== 이미지 검증 시작 ==="
2020
echo "대상: $CONTENT_DIR | 최소 이미지: ${MIN_IMAGES}"
2121
echo ""
2222

23-
for file in "$CONTENT_DIR"/*.md; do
23+
for file in "$CONTENT_DIR"/*/index.md "$CONTENT_DIR"/*.md; do
2424
[ -f "$file" ] || continue
2525

26-
filename=$(basename "$file")
26+
filename=$(basename "$(dirname "$file")")
27+
[ "$filename" = "$(basename "$CONTENT_DIR")" ] && filename=$(basename "$file")
2728

2829
# _index.md 는 건너뛰기
29-
if [ "$filename" = "_index.md" ]; then
30+
if [ "$(basename "$file")" = "_index.md" ]; then
3031
SKIPPED=$((SKIPPED + 1))
3132
continue
3233
fi

0 commit comments

Comments
 (0)