diff --git a/CLAUDE.md b/CLAUDE.md index 6e4bf42..295f7b7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,6 +63,7 @@ dist/ 빌드 산출물(.gitignore) "kakao": "" }, "shop": { + "kit_slug": "2026-10-kit-first-stitch", "store_url": "https://smartstore.naver.com/", "kit_url": "https://smartstore.naver.com/", "kit_note": "키트에 들어가는 것 한 줄" @@ -81,23 +82,24 @@ dist/ 빌드 산출물(.gitignore) ``` - `product_sort`: `newest`(기본) 또는 `oldest`. 이 값 하나로 목록 순서가 바뀐다. +- `shop.kit_slug`: 첫 페이지 '키트' 섹션에 쓸 작품의 slug. 작품 slug 를 바꾸면 여기도 함께 고친다. - 문구를 고치라는 요청은 대부분 이 파일만 고치면 끝난다. ## 3. content/products/.md 스키마 ```markdown --- -slug: whitework-tea-mat # 영문 소문자·하이픈, URL 이 된다(/p/whitework-tea-mat.html) +slug: 2026-10-whitework-tea-mat # 파일명과 같다. `연-월-영문제목` → /p/2026-10-whitework-tea-mat.html title: 목련 한 땀 티매트 subtitle: 봄볕에 널어둔 천 date: 2026-10-28 # 목록 정렬 기준 price: 58000 # 원 단위 정수. 비우면 "문의" sold_out: false featured: true # 첫 페이지 상단에 크게 노출 -image: assets/img/work-whitework.jpg +image: assets/img/2026-10-whitework-tea-mat/cover.jpg image_alt: 아이보리 린넨 위에 흰 실로 목련을 놓은 티매트 -gallery: # 선택. 상세 페이지 추가 이미지 - - assets/img/work-whitework.jpg +gallery: # 선택. 상세 페이지 추가 이미지 (같은 작품 폴더에 둔다) + - assets/img/2026-10-whitework-tea-mat/detail-01.jpg material: 린넨 100% size: 30 × 45 cm care: 미지근한 물에 중성세제로 단독 손세탁 @@ -107,8 +109,10 @@ naver_url: "" # 비우면 구매 버튼 대신 "네이버 스 ``` - **새 작품 추가 = 이 파일 1개 추가 → `python3 build.py`.** 목록과 상세가 자동 생성된다. -- `slug` 는 파일명과 같게 유지한다. -- 이미지 파일은 `assets/img/` 에 넣고 파일명은 영문 소문자·하이픈. +- 파일명 = `slug` = **`연-월-영문제목`** (예: `2026-11-magnolia-tea-mat.md`). 앞의 연-월로 시기를 바로 구분하고 `ls`·`git log` 가 시간순으로 정렬된다. 한국어 제목은 `title` 에 쓴다(URL 은 영문 유지). +- **작품 이미지는 `assets/img//` 폴더에 넣는다** — 대표는 `cover.jpg`, 추가 컷은 `detail-01.jpg` 처럼. 작품마다 폴더 하나, 다른 작품과 섞지 않는다. +- 공정·브랜드 공용 이미지는 `assets/img/process/` 에 둔다. +- 사이트가 JPEG 헤더에서 크기를 읽으므로 **JPG 만** 쓴다(PNG·WebP 는 빌드 실패). ## 4. content/process/*.md 스키마 @@ -116,7 +120,7 @@ naver_url: "" # 비우면 구매 버튼 대신 "네이버 스 --- step: 1 title: 실 고르기 -image: assets/img/craft-jogakbo.jpg +image: assets/img/process/fabric.jpg image_alt: 조각보 --- 한 문단. 무엇을 보고 고르는지. diff --git a/README.md b/README.md index 280cc28..5e64592 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,14 @@ bash scripts/rollback.sh 2f22e71 # 특정 커밋 시점으로 내용 되돌 ## 작품 하나 추가하기 -1. 사진을 `assets/img/` 에 넣는다 (파일명은 영문 소문자-하이픈, 예: `magnolia-02.jpg`) -2. `content/products/magnolia-02.md` 를 만든다 — front matter 스키마는 `CLAUDE.md` 3절 -3. `python3 build.py` -4. `bash scripts/deploy.sh` +1. slug 를 정한다 — **`연-월-영문제목`** (예: `2026-11-magnolia-tea-mat`). 파일명 = slug = URL +2. 사진을 **`assets/img/2026-11-magnolia-tea-mat/`** 폴더에 넣는다 (대표 `cover.jpg`, 추가 컷은 `detail-01.jpg`) +3. `content/products/2026-11-magnolia-tea-mat.md` 를 만든다 — front matter 스키마는 `CLAUDE.md` 3절 +4. `python3 build.py` +5. `bash scripts/deploy.sh` + +작품마다 폴더 하나. 사진이 많아져도 작품별로 모여 있고, 파일명 앞의 연-월로 시기가 바로 보인다. +공정 사진처럼 여러 곳에서 쓰는 이미지는 `assets/img/process/` 에 둔다. 목록과 상세 페이지는 자동으로 생긴다. 코드는 건드리지 않는다. @@ -51,7 +55,7 @@ bash scripts/studio.sh # http://localhost:8081 - `배포까지` 체크하면 저장과 동시에 `scripts/deploy.sh` 실행 - 상단 `이력 / 되돌리기` = 최근 커밋 목록과 `git revert` - 작품 상세 페이지의 `이 작품 고치기` 버튼은 localhost 에서만 보인다 (운영 사이트에서는 hidden) -- 이미지: JPG 를 끌어다 놓으면 `assets/img/` 에 저장되고 경로가 자동 입력된다 +- 이미지: JPG 를 끌어다 놓으면 `assets/img/<슬러그>/` 에 저장되고 경로가 자동 입력된다 (PNG 는 빌드가 못 읽어 거부) - **AI 프롬프트**: 입력창에 말로 시키면 부제·본문·소재·규격을 고친 제안을 보여준다. 아무것도 자동 저장되지 않고 `폼에 적용` 또는 `적용하고 저장`을 눌러야 반영된다 - 모드 `새 작품 초안` = 제목·가격·규격을 주면 원고와 slug 를 만들어 폼에 열어준다(이미지·슬러그 확인 후 저장) - 모델 `deepseek-flash`. 키는 `~/.config/teamat-studio/ai.json`(600) 또는 `DEEPSEEK_API_KEY` @@ -84,9 +88,9 @@ Claude Code 에 말로 지시하면 위 파일들을 알아서 고친다. 예: | 파일 | 원본 | 라이선스 | |---|---|---| -| `work-whitework.jpg` | Linen towel with drawn threadwork and whitework embroidery (Wikimedia Commons) | Public domain | -| `work-green-linen.jpg` | Japanese flat silk embroidery on leno-weave fabric / Ineffablebookkeeper | CC BY-SA 4.0 | -| `craft-jogakbo.jpg` | Wrapping cloth (bojagi), Korea / Hiart | CC0 | +| `2026-10-whitework-tea-mat/cover.jpg` | Linen towel with drawn threadwork and whitework embroidery (Wikimedia Commons) | Public domain | +| `2026-10-cedar-tea-mat/cover.jpg`, `process/stitch.jpg` | Japanese flat silk embroidery on leno-weave fabric / Ineffablebookkeeper | CC BY-SA 4.0 | +| `2026-10-kit-first-stitch/cover.jpg`, `process/fabric.jpg` | Wrapping cloth (bojagi), Korea / Hiart | CC0 | 실제 작품 사진으로 교체하면 해당 표기와 `site.json` 의 `image_credits` 도 함께 정리한다. diff --git a/assets/img/work-green-linen.jpg b/assets/img/2026-10-cedar-tea-mat/cover.jpg similarity index 100% rename from assets/img/work-green-linen.jpg rename to assets/img/2026-10-cedar-tea-mat/cover.jpg diff --git a/assets/img/craft-jogakbo.jpg b/assets/img/2026-10-kit-first-stitch/cover.jpg similarity index 100% rename from assets/img/craft-jogakbo.jpg rename to assets/img/2026-10-kit-first-stitch/cover.jpg diff --git a/assets/img/work-whitework.jpg b/assets/img/2026-10-whitework-tea-mat/cover.jpg similarity index 100% rename from assets/img/work-whitework.jpg rename to assets/img/2026-10-whitework-tea-mat/cover.jpg diff --git a/assets/img/process/fabric.jpg b/assets/img/process/fabric.jpg new file mode 100644 index 0000000..3bf2d16 Binary files /dev/null and b/assets/img/process/fabric.jpg differ diff --git a/assets/img/process/stitch.jpg b/assets/img/process/stitch.jpg new file mode 100644 index 0000000..bdebda5 Binary files /dev/null and b/assets/img/process/stitch.jpg differ diff --git a/build.py b/build.py index f8245f1..74ec524 100644 --- a/build.py +++ b/build.py @@ -432,9 +432,12 @@ def build_index( hero_image = str(featured["image"]) hero_width, hero_height = image_size(hero_image) - kit = next((p for p in products if p["slug"] == "kit-first-stitch"), None) + kit_slug = str(site.get("shop", {}).get("kit_slug", "")).strip() + kit = next((p for p in products if p["slug"] == kit_slug), None) if kit_slug else None if kit is None: - fail("content/products/kit-first-stitch.md 가 필요합니다.") + kit = next((p for p in products if p["slug"].endswith("kit-first-stitch")), None) + if kit is None: + fail("키트로 쓸 작품이 없습니다. content/site.json 의 shop.kit_slug 를 지정하세요.") kit_image = str(kit["image"]) kit_width, kit_height = image_size(kit_image) kit_body_html = markdown_to_html(kit["body"]) diff --git a/content/process/01-fabric.md b/content/process/01-fabric.md index 7ec54de..54a57fd 100644 --- a/content/process/01-fabric.md +++ b/content/process/01-fabric.md @@ -1,7 +1,7 @@ --- step: 1 title: 천 고르기 -image: assets/img/craft-jogakbo.jpg +image: assets/img/process/fabric.jpg image_alt: 여러 색 천 조각을 이어 붙인 조각보 --- 린넨은 물에 한 번 담갔다 말려 수축을 빼고 시작합니다. 햇빛에 비춰 올이 고른 쪽, 빛을 고르게 받는 쪽을 고릅니다. 천의 폭이 좁으면 두 폭을 이어 붙입니다. diff --git a/content/process/03-stitch.md b/content/process/03-stitch.md index 233f200..a1c1812 100644 --- a/content/process/03-stitch.md +++ b/content/process/03-stitch.md @@ -1,7 +1,7 @@ --- step: 3 title: 한 땀 놓기 -image: assets/img/work-green-linen.jpg +image: assets/img/process/stitch.jpg image_alt: 성긴 직물 위에 녹색 실로 놓은 자수 --- 실은 한 번에 길게 빼지 않습니다. 한 땀 놓고, 손을 내리고, 다시 바늘을 잡습니다. 꽃잎은 안쪽에서 바깥으로, 잎은 줄기에서 끝으로 놓습니다. 하루에 두어 시간이 지나면 손목이 먼저 쉬자고 합니다. diff --git a/content/products/cedar-tea-mat.md b/content/products/2026-10-cedar-tea-mat.md similarity index 92% rename from content/products/cedar-tea-mat.md rename to content/products/2026-10-cedar-tea-mat.md index ca06fea..9e65226 100644 --- a/content/products/cedar-tea-mat.md +++ b/content/products/2026-10-cedar-tea-mat.md @@ -1,12 +1,12 @@ --- -slug: cedar-tea-mat +slug: 2026-10-cedar-tea-mat title: 솔잎 티매트 subtitle: 창가에 놓은 작은 숲 date: 2026-10-18 price: 62000 sold_out: false featured: false -image: assets/img/work-green-linen.jpg +image: assets/img/2026-10-cedar-tea-mat/cover.jpg image_alt: 성긴 아이보리 직물 위에 녹색 실로 잎을 놓은 티매트 gallery: material: 린넨 100%, 면사 자수 diff --git a/content/products/kit-first-stitch.md b/content/products/2026-10-kit-first-stitch.md similarity index 91% rename from content/products/kit-first-stitch.md rename to content/products/2026-10-kit-first-stitch.md index 7b88ac1..2ab5b10 100644 --- a/content/products/kit-first-stitch.md +++ b/content/products/2026-10-kit-first-stitch.md @@ -1,12 +1,12 @@ --- -slug: kit-first-stitch +slug: 2026-10-kit-first-stitch title: 처음 한 땀 티매트 키트 subtitle: 천과 실, 도안이 함께 오는 상자 date: 2026-10-05 price: 32000 sold_out: false featured: false -image: assets/img/craft-jogakbo.jpg +image: assets/img/2026-10-kit-first-stitch/cover.jpg image_alt: 여러 천 조각을 이어 붙인 조각보 gallery: material: 린넨 천, 면사, 도안, 바늘 diff --git a/content/products/whitework-tea-mat.md b/content/products/2026-10-whitework-tea-mat.md similarity index 91% rename from content/products/whitework-tea-mat.md rename to content/products/2026-10-whitework-tea-mat.md index 810bf1f..2e5e68c 100644 --- a/content/products/whitework-tea-mat.md +++ b/content/products/2026-10-whitework-tea-mat.md @@ -1,12 +1,12 @@ --- -slug: whitework-tea-mat +slug: 2026-10-whitework-tea-mat title: 목련 한 땀 사시코 티매트 subtitle: 봄볕에 널어둔 천 date: 2026-10-28 price: 58000 sold_out: false featured: true -image: assets/img/work-whitework.jpg +image: assets/img/2026-10-whitework-tea-mat/cover.jpg image_alt: 아이보리 린넨 위에 흰 실로 문양을 놓은 티매트 gallery: material: 린넨 100%, 면사 자수 diff --git a/content/site.json b/content/site.json index 992acf8..6c59895 100644 --- a/content/site.json +++ b/content/site.json @@ -12,6 +12,7 @@ "kakao": "" }, "shop": { + "kit_slug": "2026-10-kit-first-stitch", "store_url": "", "kit_url": "", "kit_note": "린넨 천, 면사, 도안, 바늘 — 처음 시작하는 사람에게 필요한 것들" diff --git a/studio/ai_test.py b/studio/ai_test.py index 5a827a0..21fb5fd 100644 --- a/studio/ai_test.py +++ b/studio/ai_test.py @@ -44,7 +44,7 @@ before_head = subprocess.run(["git", "rev-parse", "--short", "HEAD"], cwd="/User capture_output=True, text=True).stdout.strip() # 1) 작품 수정 제안 -code, data = post("/api/ai", {"mode": "edit", "slug": "whitework-tea-mat", +code, data = post("/api/ai", {"mode": "edit", "slug": "2026-10-whitework-tea-mat", "prompt": "부제를 더 담백하게, 20자 이내로. 본문은 그대로 둬."}) check("edit 200", code == 200 and data.get("ok") is True, json.dumps(data, ensure_ascii=False)[:400]) if data.get("ok"): @@ -57,7 +57,7 @@ if data.get("ok"): print(f" {k}: {str(v)[:120]}") # 2) 본문 다시 쓰기 -code, data2 = post("/api/ai", {"mode": "edit", "slug": "whitework-tea-mat", +code, data2 = post("/api/ai", {"mode": "edit", "slug": "2026-10-whitework-tea-mat", "prompt": "본문을 3문단으로 다시 써. 재료와 걸린 시간을 숫자로 넣어."}) if data2.get("ok"): body = data2.get("changes", {}).get("body", "") @@ -77,7 +77,7 @@ if draft.get("ok"): print(" 초안:", fields.get("slug"), "|", fields.get("title"), "|", fields.get("price"), "|", fields.get("size")) # 4) 빈 요청 거부 -code, bad = post("/api/ai", {"mode": "edit", "slug": "whitework-tea-mat", "prompt": ""}) +code, bad = post("/api/ai", {"mode": "edit", "slug": "2026-10-whitework-tea-mat", "prompt": ""}) check("빈 요청 거부", code == 400, str(code)) # 5) AI 호출이 저장소를 건드리지 않아야 한다 diff --git a/studio/app.html b/studio/app.html index b946bd6..b602a05 100644 --- a/studio/app.html +++ b/studio/app.html @@ -391,7 +391,7 @@ function fieldHtml(f, value) { '' + '' + '' + - 'JPG를 여기로 끌어다 놓아도 됩니다 (assets/img 에 저장)'; + 'JPG를 끌어다 놓으면 assets/img/<슬러그>/ 에 저장됩니다'; } const type = f.type === 'number' ? 'number' : (f.type === 'date' ? 'date' : (f.type === 'url' ? 'url' : 'text')); return '