Compare commits

...
44 Commits
Author SHA1 Message Date
koreafood ecc8ab4474 deploy: umbrel 라이브 dist 직접 서빙으로 전환 — QNAP rsync 제거(2026-11-27) 2026-11-26 18:55:11 +00:00
koreafood beaaf6555c update 2026-11-20 21:47:28 +09:00
koreafood 72e1926d87 카톡 채널 연결 버그 수정·canonical 추가·모바일 내비 터치 영역 확대
- templates/index.html: 인라인 스크립트 문자열에 실제 개행이 들어가 문법 오류 → 카톡 문의 버튼이 동작하지 않던 문제 (배열 join으로 교체)
- content/site.json: 카톡 채널 주소 추가
- templates/base.html: canonical 태그, 헤더 앵커를 같은 페이지에서는 #앵커로 (불필요한 재로딩 제거)
- assets/css/site.css: 모바일 내비 터치 영역 45px (음수 마진으로 글자 위치 유지)
2026-11-01 18:59:49 +09:00
한땀 작업실 7aaa488825 작품 삭제: 솔잎 티매트 2026-11-01 08:12:19 +00:00
한땀 작업실 ddae2c776a 이력 행: 되돌리기 버튼 줄바꿈 방지 2026-11-01 08:09:35 +00:00
한땀 작업실 e1ddbff1f5 되돌리기 화면: 폰 목록 맨 아래 최근 이력 → 그 커밋 revert(초안 있으면 배포만 건너뜀) 2026-11-01 08:08:08 +00:00
한땀 작업실 3d5a015400 작품 삭제 기능: 수정 화면 DELETE — md·사진·페이지 제거, 되돌리기로 복구, 키트/마지막 작품 보호 2026-11-01 07:59:57 +00:00
한땀 작업실 bdbad3ec6d 작품 수정: 코펜하겐, 천 위에 앉히다 2026-11-01 07:48:39 +00:00
한땀 작업실 d84b4e4d61 상품 추가: 코펜하겐, 천 위에 앉히다 (가격 문의) 2026-11-01 06:10:11 +00:00
한땀 작업실 b81eb5745f 작품 수정: 쪽빛 사시코 티매트 2026-11-01 05:57:28 +00:00
한땀 작업실 7619eef367 상품 추가: 파란 천 위의 흰 올 (15000) 2026-11-01 05:37:08 +00:00
한땀 작업실 9434a08480 작품 목록 제목: 판매 중인 작품 -> 작품 2026-11-01 05:10:29 +00:00
한땀 작업실 b803ab4efd 작품 목록 분리: 판매 중 / 판매 완료(카톡 제작 문의 버튼) 2026-11-01 04:56:29 +00:00
한땀 작업실 aba5d4d6e2 상세 페이지 순서: 작은 제목 → 메인사진 → 서브사진 → 스토리 → 맨 아래 DETAILS(구매·소재·규격) 2026-11-01 04:48:34 +00:00
한땀 작업실 ebbec84ba6 어투 지침: 마지막 여운 문장을 작품마다 다르게(상투적 표현 금지) 2026-11-01 04:43:54 +00:00
한땀 작업실 c10a1c76fb 작품 수정: 사시코 티코스터 패키지 2026-11-01 04:43:40 +00:00
한땀 작업실 09ad856c0b 작품 수정: 처음 한 땀 티매트 키트 2026-11-01 04:43:37 +00:00
한땀 작업실 bc01e7cfe6 작품 수정: 솔잎 티매트 2026-11-01 04:43:35 +00:00
한땀 작업실 9c234b0c43 작품 수정: 쪽빛 사시코 티매트 2026-11-01 04:43:31 +00:00
한땀 작업실 07900de9aa 작품 수정: 자주색 위의 벚꽃 2026-11-01 04:43:28 +00:00
한땀 작업실 dd203f2113 작품 수정: 사시코 티코스터 패키지 2026-11-01 04:42:36 +00:00
한땀 작업실 71a01228c6 작품 수정: 처음 한 땀 티매트 키트 2026-11-01 04:42:34 +00:00
한땀 작업실 c766e70922 작품 수정: 솔잎 티매트 2026-11-01 04:42:22 +00:00
한땀 작업실 aa79358d64 작품 수정: 쪽빛 사시코 티매트 2026-11-01 04:42:14 +00:00
한땀 작업실 53477b387d 어투: 기본을 우아한(고급 문어체)으로 — 어휘 상향·구어체/행정어 금지·마지막 문단에 온기 2026-11-01 04:39:29 +00:00
한땀 작업실 97a6961d88 작품 수정: 자주색 위의 벚꽃 2026-11-01 04:38:57 +00:00
한땀 작업실 02e654d75e 본문 어투: 기본 다정한 톤 + 다정한/담백한/서정적인 선택과 다시 쓰기(미리보기·적용) 2026-11-01 04:34:37 +00:00
한땀 작업실 a749b9daf8 작품 수정: 자주색 위의 벚꽃 2026-11-01 04:33:26 +00:00
한땀 작업실 a6835e943a 등록 화면: 작품 수정(사진 재배치·삭제·추가, 항목 편집, 저장/배포) + 배포 시 재빌드 2026-11-01 04:28:53 +00:00
한땀 작업실 f2ae889795 Revert "상품 추가: 수정 시험 작품 (9000)"
This reverts commit 43332601d3.
2026-11-01 04:28:23 +00:00
한땀 작업실 51f3cdbe1c Revert "작품 수정: 수정한 작품 제목"
This reverts commit 481831e00d.
2026-11-01 04:28:23 +00:00
한땀 작업실 481831e00d 작품 수정: 수정한 작품 제목 2026-11-01 04:28:06 +00:00
한땀 작업실 43332601d3 상품 추가: 수정 시험 작품 (9000) 2026-11-01 04:26:44 +00:00
한땀 작업실 5efb86b6b8 등록 화면: 목록 화면 다듬기(하단 바 숨김, 발행 버튼 조건부) + 안내 문서 2026-11-01 04:23:22 +00:00
한땀 작업실 b887c98d5f 등록 화면: 작품 목록(썸네일·미발행 표시), 저장 후 목록 복귀, 사이트에 올리기 버튼, dist 미리보기(/p, /preview) 2026-11-01 04:22:36 +00:00
한땀 작업실 b604bfe047 상품 추가: 자주색 위의 벚꽃 (가격 문의) 2026-11-01 04:17:41 +00:00
한땀 작업실 ae2cc1de7d 문서: 등록 화면을 테일넷 전용(tailscale serve, 토큰 없음)으로 갱신 2026-11-01 04:10:47 +00:00
한땀 작업실 cdf81ccc4e Revert "상품 추가: 연결 시험 티코스터 (12000)"
This reverts commit fc19253ac9.
2026-11-01 04:10:33 +00:00
한땀 작업실 fc19253ac9 상품 추가: 연결 시험 티코스터 (12000) 2026-11-01 04:10:25 +00:00
한땀 작업실 574d4f53cd QNAP: 서버 포트를 로컬호스트에만 게시(테일넷 전용 접속) 2026-11-01 04:09:53 +00:00
한땀 작업실 b41d42694d 등록 화면: 아이콘·미리보기용 /assets 경로 제공 2026-11-01 03:56:17 +00:00
한땀 작업실 984fe68c12 QNAP 이전: 등록 서버를 컨테이너로(8089, Caddy teamat-admin.lala.dedyn.io), 사진 원본 보관, 웹 루트 직접 배포, Gitea 자동 푸시 2026-11-01 03:52:58 +00:00
한땀 작업실 5c5ecef578 Revert "상품 추가: 와인색 티코스터 네 장 (18000)"
This reverts commit b5296f7e08.
2026-11-01 03:52:14 +00:00
한땀 작업실 b5296f7e08 상품 추가: 와인색 티코스터 네 장 (18000) 2026-11-01 03:51:59 +00:00
47 changed files with 1466 additions and 245 deletions

No files matched your search

+1
View File
@@ -4,3 +4,4 @@ dist/
.claude/settings.local.json .claude/settings.local.json
studio/_inbox/ studio/_inbox/
__pycache__/ __pycache__/
studio/_archive/
+6 -2
View File
@@ -7,8 +7,9 @@
1. **DB·서버·CMS 를 만들지 않는다.** 정적 HTML/CSS/JS 만. Node/npm/pip 패키지 금지. 1. **DB·서버·CMS 를 만들지 않는다.** 정적 HTML/CSS/JS 만. Node/npm/pip 패키지 금지.
- 예외: `studio/` 는 사이트가 아니라 **관리 도구**다(표준 라이브러리만, `dist/` 에 포함되지 않음). - 예외: `studio/` 는 사이트가 아니라 **관리 도구**다(표준 라이브러리만, `dist/` 에 포함되지 않음).
아이맥 127.0.0.1 에서만 돌고, 폰은 테일스케일(`tailscale serve`, 127.0.0.1 로 프록시)로 접속한다. 열쇠는 `~/.config/teamat-studio/token`. QNAP 컨테이너(`teamat-admin:1`, 호스트 8089 는 127.0.0.1 에만 게시)에서 돌고, QNAP 의 tailscale 컨테이너가
이 예외를 근거로 사이트에 서버 기능을 붙이지 않는다. `tailscale serve` 로 `https://naslala.taild8883.ts.net/` 에만 노출한다(테일넷 전용, 공개 도메인·토큰 없음).
아이맥 로컬 실행은 비상용으로만 남긴다. 이 예외를 근거로 사이트에 서버 기능을 붙이지 않는다.
2. **빌드는 `python3 build.py` 하나.** 표준 라이브러리만 사용. 2. **빌드는 `python3 build.py` 하나.** 표준 라이브러리만 사용.
- AI(DeepSeek) 호출은 `studio/server.py` 안에서만. 빌드·사이트 코드에 AI 를 넣지 않는다. - AI(DeepSeek) 호출은 `studio/server.py` 안에서만. 빌드·사이트 코드에 AI 를 넣지 않는다.
- AI 제안은 사람이 적용·저장해야 파일이 바뀐다(자동 저장 금지). AI 가 쓴 수치는 저장 전에 확인한다. - AI 제안은 사람이 적용·저장해야 파일이 바뀐다(자동 저장 금지). AI 가 쓴 수치는 저장 전에 확인한다.
@@ -112,6 +113,7 @@ naver_url: "" # 스마트스토어 상품 주소. 비우면
``` ```
- **새 작품 추가 = 이 파일 1개 추가 → `python3 build.py`.** 목록과 상세가 자동 생성된다. - **새 작품 추가 = 이 파일 1개 추가 → `python3 build.py`.** 목록과 상세가 자동 생성된다.
- `sold_out: true` 인 작품은 첫 페이지의 **판매 완료 섹션**으로 내려가고, 카드·상세에 `카톡으로 제작 문의` 버튼이 붙는다. 판매 재개는 `false` 로 되돌리는 것.
- 파일명 = `slug` = **`연-월-영문제목`** (예: `2026-11-magnolia-tea-mat.md`). 앞의 연-월로 시기를 바로 구분하고 `ls`·`git log` 가 시간순으로 정렬된다. 한국어 제목은 `title` 에 쓴다(URL 은 영문 유지). - 파일명 = `slug` = **`연-월-영문제목`** (예: `2026-11-magnolia-tea-mat.md`). 앞의 연-월로 시기를 바로 구분하고 `ls`·`git log` 가 시간순으로 정렬된다. 한국어 제목은 `title` 에 쓴다(URL 은 영문 유지).
- **작품 이미지는 `assets/img/<slug>/` 폴더에 넣는다** — 대표는 `cover.jpg`, 추가 컷은 `detail-01.jpg` 처럼. 작품마다 폴더 하나, 다른 작품과 섞지 않는다. - **작품 이미지는 `assets/img/<slug>/` 폴더에 넣는다** — 대표는 `cover.jpg`, 추가 컷은 `detail-01.jpg` 처럼. 작품마다 폴더 하나, 다른 작품과 섞지 않는다.
- 공정·브랜드 공용 이미지는 `assets/img/process/` 에 둔다. - 공정·브랜드 공용 이미지는 `assets/img/process/` 에 둔다.
@@ -156,6 +158,8 @@ image_alt: 조각보
- 제목: `Noto Serif KR` (serif), 본문: `Noto Sans KR` (sans). CDN 실패 시 시스템 폰트 폴백. - 제목: `Noto Serif KR` (serif), 본문: `Noto Sans KR` (sans). CDN 실패 시 시스템 폰트 폴백.
- 여백 위주, 그림자·그라데이션·둥근 카드 금지. 구분은 1px 실선. - 여백 위주, 그림자·그라데이션·둥근 카드 금지. 구분은 1px 실선.
- 사진이 주인공: 최소 60vw 폭 또는 4:5 세로 컷. 호버 확대는 1.02 이하. - 사진이 주인공: 최소 60vw 폭 또는 4:5 세로 컷. 호버 확대는 1.02 이하.
- **상세 페이지 순서는 고정**: ① 작은 제목(+부제·가격, `product-head`) ② 메인 사진(`product-hero`, 폭 min(100%,1080px), 자르지 않고 원본 비율)
③ 서브 사진(`gallery`, 한 열로 세로로 이어 붙임) ④ 스토리(`product-story`) ⑤ DETAILS(구매 버튼 + 소재·규격·세탁 `spec`) — 사양은 항상 맨 아래.
## 7. 자주 쓰는 명령 ## 7. 자주 쓰는 명령
+50 -11
View File
@@ -73,20 +73,59 @@ bash scripts/studio.sh # http://localhost:8081
- 단축키: `/` 검색, `↑↓` 이동, `⌘S` 저장, 프롬프트에서 `⌘Enter` 실행 - 단축키: `/` 검색, `↑↓` 이동, `⌘S` 저장, 프롬프트에서 `⌘Enter` 실행
- 서버는 `127.0.0.1` 에만 붙는다. 외부에서 접근되지 않는다 - 서버는 `127.0.0.1` 에만 붙는다. 외부에서 접근되지 않는다
## 폰에서 등록 (휴대폰 관리 화면) ## 폰에서 등록 (QNAP 관리 화면)
사진을 찍고 내용을 쓰면 상세 페이지 한 장이 만들어지는 화면. 아이맥에서 도는 서버를 테일스케일로 폰에서 연다. 사진을 찍고 내용을 쓰면 상세 페이지 한 장이 만들어지는 화면. **QNAP 컨테이너에서 돌고, 테일넷 안에서만 열린다.**
- 주소: `https://imac.taild8883.ts.net/m` — 테일스케일 안에서만 열린다. **처음 한 번** `?t=<토큰>` 을 붙여야 하고, 그 뒤로는 쿠키에 남는다. - 주소: `https://naslala.taild8883.ts.net/` — 열쇠(토큰) 없다. 테일스케일이 켜진 내 기기에서만 접속된다.
- 토큰: `cat ~/.config/teamat-studio/token` (아이맥). 홈 화면에 추가하면 앱처럼 열린다(PWA). (공개 도메인 `teamat-admin.lala.dedyn.io` 는 만들었다가 내렸다. 필요하면 다시 만들 수 있지만 열쇠 없이 공개하면 안 된다.)
- 홈 화면에 추가하면 앱처럼 열린다(PWA). 사진·음성 입력은 HTTPS 라서 그대로 동작한다.
- 첫 화면은 **작품 목록**이다(썸네일·부제·가격, 최근 순). 카드를 누르면 방금 만든 페이지가 그대로 열린다(빌드 결과 `dist` 를 서버가 서빙: `/p/<slug>.html`, 사이트 전체는 `/preview`).
- 흐름: ① 사진 찍기(여러 장, 첫 장이 대표) → ② 내용 작성(사진을 읽어 초안) → ③ 규격·소재·세탁 칩 + 가격 → ④ 확인 후 저장 - 흐름: ① 사진 찍기(여러 장, 첫 장이 대표) → ② 내용 작성(사진을 읽어 초안) → ③ 규격·소재·세탁 칩 + 가격 → ④ 확인 후 저장
- 저장 = `사진 변환 → content/products/<slug>.md → build.py → git commit`(경로만 지정해 커밋). `사이트에 올리기` 를 누르면 `scripts/deploy.sh` 까지 실행한다. - 저장하면 완료 화면에 `목록으로 돌아가기` 가 나오고, 목록의 그 작품에 `방금 등록` 배지가 붙는다. `저장만` 으로 저장한 작품은 `미발행` 배지가 붙는다.
- 사진은 `studio/_inbox/` 에 잠시 쌓였다가 저장할 때 `assets/img/<slug>/cover.jpg`, `detail-NN.jpg` 로 옮긴다(인박스는 커밋하지 않는다). - 목록 위 `사이트에 올리기 (미발행 N점)` = 커밋된 상태를 그대로 배포한다. 커밋 안 된 초안이 있으면 먼저 물어본다. 배포 후 배지는 사라진다.
- **어투(말투)**: AI 원고의 기본은 `우아한` — '~습니다'체 문어체에 어휘를 한 단계 높이고('수놓다·앉히다·결·올·여백·온기'),
구어체('~해 줘요')와 행정적 동사('구성하다·제작하다')를 피하며, 마지막 문단에 손끝의 온기를 한 문장으로 남긴다.
신규 등록 화면과 수정 화면에 `다정한 / 담백한 / 서정적인` 칩이 있고, 수정 화면에서는 `이 어투로 다시 쓰기` 로 본문만 다시 쓴 뒤 `본문에 적용`(저장은 따로)한다.
어투 정의는 `studio/register.py` 의 `TONES` — 문구를 고치면 두 화면·재작성·신규 원고에 모두 반영된다.
- **고치기**: 목록 카드 오른쪽 `수정` → 제목·부제·본문·규격·소재·세탁·가격·날짜·네이버 링크·대표작/품절을 그대로 불러온다.
사진은 순서 바꾸기(첫 장이 대표)·삭제·추가(촬영/앨범)가 되고, 저장하면 `assets/img/<slug>/` 를 다시 정리한다(쓰지 않는 사진은 지운다).
`저장하고 사이트에 올리기` 또는 `저장만`. 저장 = md 재작성 → build → 커밋(`작품 수정: 제목`) → push.
- **삭제**: 수정 화면 맨 아래 `이 작품 삭제` → 확인 창 한 번이면 지운다. md + `assets/img/<slug>/` 를 함께 지우고
`작품 삭제: 제목` 커밋을 남긴 뒤 사이트에서도 내린다(목록·첫 페이지·상세 페이지에서 사라진다).
찍은 원본은 `data/photos/<slug>/` 에 남고, 이력에서 그 커밋을 되돌리면 md·사진·페이지가 그대로 살아난다.
실수 방지로 **첫 페이지 키트(`site.json` 의 `shop.kit_slug`)와 마지막 남은 한 점은 거부**한다.
커밋 안 된 다른 초안이 있으면 삭제는 하되 배포는 건너뛴다(목록의 `사이트에 올리기` 로 마저 올린다).
- `/m?slug=<슬러그>` 로 들어가면 그 작품 수정 화면이 바로 열린다.
- 목록 맨 아래 `최근 이력 · 되돌리기` = 최근 커밋 25개 목록. `되돌리기` 를 누르면 그 커밋을 `git revert` 하고(사이트 반영까지)
지운 작품을 되살린다. 커밋 안 된 초안이 있으면 되돌리기는 하되 배포는 건너뛴다.
- `사이트에 올리기` 는 **빌드까지 다시 한 뒤** 복사한다(되돌리기·수동 편집 뒤에도 안전).
- 저장 = `사진 축소(Pillow) → content/products/<slug>.md → build.py → git commit`(경로만 지정) → `git push`(Gitea). `사이트에 올리기` 를 누르면 `dist/` 를 웹 루트로 복사한다.
- 사진은 `studio/_inbox/` 에 잠시 쌓였다가 발행 시 두 곳으로 나뉜다.
- 사이트용: `assets/img/<slug>/cover.jpg`, `detail-NN.jpg` (저장소에 커밋. 최대 1400px, 품질 82)
- 원본 보관: `/share/CACHEDEV8_DATA/docker/teamat-admin/data/photos/<slug>/` (찍은 그대로. 나중에 다시 자를 때 쓴다)
- 커밋되지 않은 **다른 초안**이 있으면 배포를 건너뛰고 알려준다. 그 초안까지 올리려면 화면의 `다른 초안도 함께 올리기` 를 켠다. - 커밋되지 않은 **다른 초안**이 있으면 배포를 건너뛰고 알려준다. 그 초안까지 올리려면 화면의 `다른 초안도 함께 올리기` 를 켠다.
- 서버 상시 실행: `bash scripts/studio-service.sh install` (launchd `io.lala.teamat-studio`, 로그 `~/Library/Logs/teamat-studio.log`). `status` / `stop` 도 같은 스크립트. - 저장소(작업 사본)는 QNAP 에 있다: `/share/CACHEDEV8_DATA/docker/teamat-admin/repo`. 아이맥에서 편집하려면 `git pull` 로 받는다.
- 아이맥이 잠자기면 접속되지 않는다. 아이맥을 깨우면 다시 붙는다. - 접속 경로: 컨테이너 포트는 **127.0.0.1 에만** 게시하고(`-p 127.0.0.1:8089:8089`), QNAP 의 tailscale 컨테이너(호스트 네트워크)가 `tailscale serve --bg --https=443 http://127.0.0.1:8089` 로 테일넷에만 노출한다. Caddy·공인 DNS 는 쓰지 않는다.
- 키: `~/.config/teamat-studio/ai.json`(DeepSeek, 문장), `vision.json`(NVIDIA VLM, 사진 판독). 둘 다 `chmod 600`, 저장소에는 넣지 않는다. - 컨테이너 관리 (QNAP): `bash repo/scripts/run-qnap.sh build|up|down|logs` · 이미지 `teamat-admin:1` · 호스트 포트 8089(로컬 전용)
- 폰에서 사진 판독이나 AI 를 못 쓰면 메모만으로 초안을 쓴다(사진 없이도 저장은 되지만 사진 1장은 필수). - 설정 파일(저장소에 넣지 않는다, `chmod 600`): `/share/CACHEDEV8_DATA/docker/teamat-admin/config/{ai.json,vision.json}` — ai.json(문장), vision.json(사진 판독).
- 열쇠를 다시 켜고 싶으면 `config/token.disabled` 를 `config/token` 으로 되돌리고 컨테이너를 재시작한다(그때는 `?t=<토큰>` 이 필요해진다).
- 데스크톱 편집 화면은 같은 주소의 `/desk`.
비상용: 아이맥에서만 돌리는 예전 방식도 남아 있다. `bash scripts/studio-service.sh install`(launchd) + `tailscale serve --bg 8081` → `https://imac.taild8883.ts.net/m`. 지금은 꺼 둔다.
## 작품 목록 — 판매 중 / 판매 완료
- 첫 페이지 작품 섹션은 둘로 나뉜다. 위는 **작품**(`sold_out: false`), 아래는 **지난 작품 — 제작 문의**(`sold_out: true`).
- 판매 완료 카드에는 `카톡으로 제작 문의` 버튼이 붙고, 상세 페이지에도 같은 버튼이 들어간다(품절 안내 문구 대신).
- 버튼 동작: 문의 문구(작품명·원하는 시기·크기/색상·문의 내용)를 클립보드에 복사하고 카톡을 연다. `site.json` 의 `contact.kakao` 에 카카오채널 1:1 채팅 주소(`https://pf.kakao.com/_XXXX/chat`)를 넣으면 그 대화창이 바로 열린다. 비어 있으면 `kakaotalk://` 로 앱만 열리므로, 문구를 붙여넣어 보내면 된다.
- 판매 완료 작품이 하나도 없으면 섹션은 빈 안내 문구만 보여준다(나중에 팔리면 자동으로 채워진다).
- 문구는 `site.json` 의 `sold_works_note`.
## 상세 페이지 구성
① 작은 제목·부제·가격 → ② 메인 사진(자르지 않고 폭 1080px) → ③ 서브 사진(한 열) → ④ 스토리 → ⑤ DETAILS(구매 버튼 + 소재·규격·세탁).
사진이 주인공이고 사양은 맨 아래에 둔다. 템플릿은 `templates/product.html`, 스타일은 `assets/css/site.css` 의 `/* product */` 절.
## 대화로 고치기 ## 대화로 고치기
@@ -120,5 +159,5 @@ Claude Code 에 말로 지시하면 위 파일들을 알아서 고친다. 예:
## 아직 없는 것 (의도적으로) ## 아직 없는 것 (의도적으로)
결제·회원·장바구니·**재고 개수 관리**(작품은 유일품이라 판매중/판매완료 두 상태로 충분), 게시판·리뷰, 다국어, 사이트 내 검색, 분석 스크립트. 결제·회원·장바구니·**재고 개수 관리**(작품은 유일품이라 판매중/판매완료 두 상태로 충분), 게시판·리뷰, 다국어, 사이트 내 검색, 분석 스크립트.
관리자 화면은 사이트에 없다 — 대신 별도 도구 `studio/` 가 있다(아이맥 로컬 + 테일스케일로 폰 접속). 관리자 화면은 사이트에 없다 — 대신 별도 도구 `studio/` 가 QNAP 컨테이너로 돌고, 폰에서 접속한다.
구매는 네이버 스마트스토어로 넘긴다. 구매는 네이버 스마트스토어로 넘긴다.
+176 -110
View File
@@ -772,7 +772,7 @@ strong {
.back-link { .back-link {
display: inline-block; display: inline-block;
margin-block: 8px 28px; margin-block: 8px 20px;
color: var(--muted); color: var(--muted);
font-size: 13px; font-size: 13px;
text-decoration: none; text-decoration: none;
@@ -786,47 +786,136 @@ strong {
padding-bottom: clamp(40px, 6vw, 80px); padding-bottom: clamp(40px, 6vw, 80px);
} }
.product-top { /* 제목은 작게 — 사진이 먼저 보이도록 */
.product-head {
display: grid; display: grid;
grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 4px;
gap: clamp(36px, 5vw, 80px); margin-bottom: clamp(14px, 2.5vw, 26px);
align-items: start;
} }
.product-media { .product-title {
aspect-ratio: 4 / 5; margin: 0;
overflow: hidden; font-size: clamp(1.05rem, 1.4vw, 1.3rem);
background: var(--line); font-weight: 400;
} line-height: 1.45;
letter-spacing: 0;
.product-media img {
width: 100%;
height: 110%;
object-fit: cover;
object-position: center top;
}
.product-info {
position: sticky;
top: 32px;
padding-top: clamp(8px, 3vw, 40px);
}
.product-info h1 {
font-size: clamp(2.3rem, 4.4vw, 4.1rem);
letter-spacing: -0.035em;
line-height: 1.06;
} }
.product-sub { .product-sub {
margin-top: 14px; margin: 0;
color: var(--muted); color: var(--muted);
font-size: 13px;
}
.product-head-price {
margin: 6px 0 0;
font-size: 15px;
font-variant-numeric: tabular-nums;
}
/* 1. 메인 사진 */
.product-hero {
margin: 0 auto;
width: min(100%, 1080px);
background: var(--line);
}
.product-hero img {
display: block;
width: 100%;
height: auto;
}
/* 2. 서브 사진 */
.gallery {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: clamp(6px, 1vw, 12px);
width: min(100%, 1080px);
margin: clamp(6px, 1vw, 12px) auto 0;
}
.gallery-figure {
margin: 0;
background: var(--line);
}
.gallery-figure img {
display: block;
width: 100%;
height: auto;
}
/* 3. 스토리 */
.product-story {
display: grid;
grid-template-columns: 108px minmax(0, 1fr);
gap: clamp(20px, 4vw, 56px);
align-items: start;
margin-top: clamp(48px, 7vw, 96px);
}
.product-story .label {
padding-top: 10px;
}
.prose {
max-width: 64ch;
}
.prose p {
margin-bottom: 1.4em;
font-size: 17px; font-size: 17px;
line-height: 1.85;
}
.prose p:first-child {
font-size: clamp(1.15rem, 1.6vw, 1.35rem);
line-height: 1.75;
}
.prose p:last-child {
margin-bottom: 0;
}
.prose h2 {
margin: 2em 0 0.7em;
font-size: clamp(1.3rem, 2vw, 1.6rem);
}
.prose ul {
margin-bottom: 1.4em;
padding-left: 1.2em;
}
.prose li {
margin-bottom: 0.4em;
}
.prose figure {
margin-block: 32px;
}
/* 4. 맨 아래 상품 정보 */
.product-detail {
display: grid;
grid-template-columns: 108px minmax(0, 1fr);
gap: clamp(20px, 4vw, 56px);
align-items: start;
margin-top: clamp(48px, 7vw, 96px);
}
.product-detail > .label {
padding-top: 4px;
}
.detail-body {
max-width: 52ch;
} }
.product-price { .product-price {
margin-top: 26px; margin: 0;
font-size: 18px; font-size: 16px;
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
} }
@@ -837,19 +926,19 @@ strong {
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
} }
.product-info .btn, .detail-body .btn,
.product-info .pending { .detail-body .pending {
margin-top: 24px; margin-top: 18px;
} }
.product-sold { .product-sold {
margin-top: 8px; margin-top: 10px;
color: var(--muted); color: var(--muted);
font-size: 12px; font-size: 13px;
} }
.spec { .spec {
margin-top: 44px; margin-top: 30px;
border-top: 1px solid var(--line); border-top: 1px solid var(--line);
} }
@@ -873,73 +962,52 @@ strong {
line-height: 1.6; line-height: 1.6;
} }
.product-story { /* ------------------------------------------------------------ sold out */
display: grid;
grid-template-columns: 120px minmax(0, 1fr); .soldout .section-head {
gap: clamp(20px, 4vw, 56px); border-top: 1px solid var(--line);
align-items: start; padding-top: clamp(36px, 5vw, 64px);
margin-top: clamp(72px, 10vw, 140px);
} }
.product-story .label { .soldout {
padding-top: 10px; margin-top: clamp(56px, 8vw, 112px);
} }
.prose {
max-width: 64ch; .work.is-sold .work-figure img {
filter: saturate(0.86);
opacity: 0.92;
} }
.prose p { .inquiry-btn {
margin-bottom: 1.4em; display: inline-flex;
font-size: 17px; align-items: center;
line-height: 1.85; justify-content: center;
margin-top: 14px;
padding: 11px 16px;
border: 1px solid var(--ink);
background: var(--ink);
color: var(--paper);
font-family: var(--sans, "Noto Sans KR", sans-serif);
font-size: 13px;
letter-spacing: 0.02em;
cursor: pointer;
} }
.prose p:first-child { .inquiry-btn:hover {
font-size: clamp(1.25rem, 1.9vw, 1.5rem); background: var(--sage);
line-height: 1.7; border-color: var(--sage);
} }
.prose p:last-child { .inquiry-note {
margin-bottom: 0; margin-top: 8px;
color: var(--muted);
font-size: 12px;
line-height: 1.6;
} }
.prose h2 { .detail-body .inquiry-btn {
margin: 2em 0 0.7em; margin-top: 18px;
font-size: clamp(1.4rem, 2.2vw, 1.8rem);
}
.prose ul {
margin-bottom: 1.4em;
padding-left: 1.2em;
}
.prose li {
margin-bottom: 0.4em;
}
.prose figure {
margin-block: 32px;
}
.gallery {
grid-column: 2;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
margin-top: 24px;
}
.gallery-figure {
aspect-ratio: 4 / 5;
overflow: hidden;
background: var(--line);
}
.gallery-figure img {
width: 100%;
height: 100%;
object-fit: cover;
} }
.pager { .pager {
@@ -1084,29 +1152,20 @@ strong {
gap: 48px; gap: 48px;
} }
.product-top { .product-story,
.product-detail {
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
gap: 12px;
} }
.product-info { .product-story .label,
position: static; .product-detail > .label {
padding-top: 0;
}
.product-info .spec {
margin-top: 36px;
}
.product-story {
grid-template-columns: minmax(0, 1fr);
}
.product-story .label {
padding-top: 0; padding-top: 0;
} }
.product-hero,
.gallery { .gallery {
grid-column: 1; width: 100%;
} }
.foot-meta { .foot-meta {
@@ -1129,10 +1188,17 @@ strong {
} }
.nav { .nav {
gap: 18px; gap: 0;
font-size: 12px; font-size: 12px;
} }
/* 터치 영역 44px 확보 — 음수 마진으로 글자 위치는 그대로 둔다 */
.nav a {
display: inline-block;
padding: 12px 11px;
margin-block: -12px;
}
.wordmark-en { .wordmark-en {
display: none; display: none;
} }
@@ -1224,7 +1290,7 @@ strong {
} }
.nav { .nav {
gap: 14px; gap: 0;
} }
.wordmark-ko { .wordmark-ko {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

+17 -2
View File
@@ -370,6 +370,7 @@ def build_shared(site: Dict[str, Any], home: str, asset_prefix: str) -> Dict[str
"credits": credits, "credits": credits,
"home": home, "home": home,
"asset_prefix": asset_prefix, "asset_prefix": asset_prefix,
"kakao_url": esc(str(contact.get("kakao", "")).strip()),
} }
@@ -390,6 +391,7 @@ def product_loop_items(products: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
"subtitle": esc(product.get("subtitle", "")), "subtitle": esc(product.get("subtitle", "")),
"price_text": format_price(product.get("price")), "price_text": format_price(product.get("price")),
"sold_html": sold_html, "sold_html": sold_html,
"inquiry_title": esc(product["title"]),
} }
) )
return items return items
@@ -468,6 +470,7 @@ def build_index(
"og_title": esc(title), "og_title": esc(title),
"og_description": esc(intro), "og_description": esc(intro),
"og_image": esc(absolute_url(hero_image)), "og_image": esc(absolute_url(hero_image)),
"canonical": SITE_BASE,
"og_type": "website", "og_type": "website",
"body_class": "is-home", "body_class": "is-home",
"intro": esc(intro), "intro": esc(intro),
@@ -479,7 +482,13 @@ def build_index(
"hero_material": esc(featured.get("material", "")), "hero_material": esc(featured.get("material", "")),
"hero_href": f"p/{featured['slug']}.html", "hero_href": f"p/{featured['slug']}.html",
"works_note": esc(site.get("works_note", "")), "works_note": esc(site.get("works_note", "")),
"products": product_loop_items(products), "products": product_loop_items([p for p in products if not p.get("sold_out")]),
"sold_products": product_loop_items([p for p in products if p.get("sold_out")]),
"sold_count": str(sum(1 for p in products if p.get("sold_out"))),
"sold_empty_html": ("" if any(p.get("sold_out") for p in products)
else '<p class="note">아직 판매 완료된 작품이 없습니다. 판매되면 이 자리에 모아 두고, 같은 무늬로 다시 만들 수 있도록 문의 버튼을 붙입니다.</p>'),
"sold_note": esc(site.get("sold_works_note", "")),
"kakao_url": esc(str(site.get("contact", {}).get("kakao", "")).strip()),
"process": process_loop_items(steps), "process": process_loop_items(steps),
"process_intro": esc(site.get("process_intro", "")), "process_intro": esc(site.get("process_intro", "")),
"kit_title": esc(kit["title"]), "kit_title": esc(kit["title"]),
@@ -526,7 +535,11 @@ def build_product_page(
width, height = image_size(image) width, height = image_size(image)
if product.get("sold_out"): if product.get("sold_out"):
buy_html = '<p class="pending">판매 완료 — 재제작을 원하시면 문의해 주세요</p>' buy_html = (
f'<button class="btn inquiry-btn" type="button" data-inquiry="{esc(product["title"])}">'
"카톡으로 제작 문의</button>"
'<p class="inquiry-note">재고가 없어 주문을 받은 뒤 제작합니다. 아래 문구가 복사되니 카톡 대화창에 붙여넣어 주세요.</p>'
)
else: else:
naver_url = str(product.get("naver_url", "")).strip() naver_url = str(product.get("naver_url", "")).strip()
if naver_url: if naver_url:
@@ -577,6 +590,7 @@ def build_product_page(
"og_title": esc(title), "og_title": esc(title),
"og_description": esc(description), "og_description": esc(description),
"og_image": esc(absolute_url(image)), "og_image": esc(absolute_url(image)),
"canonical": absolute_url("p/" + product["slug"] + ".html"),
"og_type": "product", "og_type": "product",
"body_class": "is-product", "body_class": "is-product",
"slug": esc(product["slug"]), "slug": esc(product["slug"]),
@@ -591,6 +605,7 @@ def build_product_page(
"price_note_html": price_note_html, "price_note_html": price_note_html,
"sold_html": '<p class="product-sold">판매 완료</p>' if product.get("sold_out") else "", "sold_html": '<p class="product-sold">판매 완료</p>' if product.get("sold_out") else "",
"buy_html": buy_html, "buy_html": buy_html,
"inquiry_title": esc(product["title"]),
"material": esc(material) or "—", "material": esc(material) or "—",
"size": esc(product.get("size", "")) or "—", "size": esc(product.get("size", "")) or "—",
"care": esc(product.get("care", "")) or "—", "care": esc(product.get("care", "")) or "—",
-21
View File
@@ -1,21 +0,0 @@
---
slug: 2026-10-cedar-tea-mat
title: 솔잎 티매트
subtitle: 창가에 놓은 작은 숲
date: 2026-10-18
price: 62000
sold_out: false
featured: false
image: assets/img/2026-10-cedar-tea-mat/cover.jpg
image_alt: 성긴 아이보리 직물 위에 녹색 실로 잎을 놓은 티매트
gallery:
material: 린넨 100%, 면사 자수
size: 32 × 48 cm
care: 미지근한 물에 중성세제로 단독 손세탁
naver_url: ""
---
성긴 린넨의 올 사이로 빛이 지나갑니다. 그 위에 녹색 면사로 솔잎을 길게 놓았습니다. 잎마다 방향을 조금씩 달리해, 같은 잎이 반복되지 않게 했습니다.
가장자리는 접어 박음질하고, 귀퉁이마다 실을 두 번 돌려 마무리했습니다. 티포트를 올리면 잎의 방향을 따라 그림자가 생깁니다.
한 점에 보름 남짓 걸렸습니다. 실의 색은 세 가지를 나란히 놓고 골랐습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
+3 -3
View File
@@ -14,8 +14,8 @@ size: 완성 10 × 10 cm × 4장
care: 완성 후 미지근한 물에 단독 손세탁 care: 완성 후 미지근한 물에 단독 손세탁
naver_url: "https://smartstore.naver.com/lalashopkr/products/5758959852" naver_url: "https://smartstore.naver.com/lalashopkr/products/5758959852"
--- ---
완제품이 아닙니다. 천에 도안이 옅게 찍혀 있고, 실과 바늘이 함께 들어 있습니다. 도안을 따라 한 땀씩 놓으면 10 × 10 cm 티매트 네 장이 됩니다. 완제품이 아닙니다. 천 위에 도안이 옅게 앉아 있고, 실과 바늘이 한 상자에 함께 들었습니다. 도안을 따라 한 땀씩 놓으면 10 × 10 cm 티매트 네 장이 됩니다.
처음이면 가장자리부터 시작하세요. 실을 길게 빼지 않고, 한 땀 놓고 손을 한 번 내리는 리듬이 익숙해지면 안쪽으로 들어갑니다. 도안은 단순하게 그렸습니다. 천의 결을 가리지 않도록. 처음이시라면 가장자리부터 시작하시면 좋습니다. 실을 길게 빼지 않고, 한 땀 놓고 손을 한 번 내리는 리듬이 익숙해지면 안쪽으로 들어갑니다. 도안은 천의 결을 가리지 않도록 단순하게 그렸습니다.
막히면 메일로 물어보셔도 됩니다. 사진 한 장을 보내주시면 어느 자리에서 멈췄는지 함께 봅니다. 막히면 메일로 연락하실 수 있습니다. 사진 한 장을 보내시면 어느 자리에서 멈추셨는지 함께 살펴보겠습니다. 한 장을 마치고 나면 바늘을 쥔 손이 조금 가벼워집니다.
+10 -10
View File
@@ -5,24 +5,24 @@ subtitle: 흰 실로 놓는 네 가지 무늬
date: 2026-10-28 date: 2026-10-28
price: 15000 price: 15000
price_note: 네 장 세트 50,000원 price_note: 네 장 세트 50,000원
sold_out: false sold_out: true
featured: true featured: true
image: assets/img/2026-10-whitework-tea-mat/lala_S033_detail_07.jpg image: assets/img/2026-10-whitework-tea-mat/cover.jpg
image_alt: 남색 면 천 네 장에 흰 실로 십자·칠보·마노하 무늬를 놓은 사시코 티매트 image_alt: 남색 면 천 네 장에 흰 실로 십자·칠보·마노하 무늬를 놓은 사시코 티매트
gallery: gallery:
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_06.jpg - assets/img/2026-10-whitework-tea-mat/detail-01.jpg
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_04.jpg - assets/img/2026-10-whitework-tea-mat/detail-02.jpg
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_10.jpg - assets/img/2026-10-whitework-tea-mat/detail-03.jpg
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_11.jpg - assets/img/2026-10-whitework-tea-mat/detail-04.jpg
material: 면 100% (남색·자주) · 사시코 실(면) material: 면 100% (남색·자주) · 사시코 실(면)
size: 10 × 10 cm (한 장) size: 10 × 10 cm (한 장)
care: 미지근한 물에 중성세제로 단독 손세탁 care: 미지근한 물에 중성세제로 단독 손세탁
naver_url: "" naver_url: ""
--- ---
짙은 남색 면 천 위에 흰 실로 사시코를 놓았습니다. 십자가 이어지는 무늬, 겹친 원이 늘어서는 칠보, 별처럼 뻗는 마노하 — 네 장에 서로 다른 무늬를 하나씩 놓았습니다. 짙은 남색 면 위에 흰 사시코 실을 앉혔습니다. 십자가 이어지는 무늬, 겹친 원이 늘어서는 칠보, 별처럼 뻗어 나가는 마노하 — 네 장에 서로 다른 무늬를 하나씩 수놓았습니다.
도안선을 따라 한 땀씩 나아갑니다. 실이 천을 지나며 결이 살아나고, 남색과 흰 실의 대비가 무늬의 선을 또렷하게 만듭니다. 실은 오리무파스 사시코실을 씁니다. 도안선을 따라 한 땀씩 나아갑니다. 실이 천의 올을 지나며 결이 살아나고, 남색과 흰 실의 대비가 무늬의 선을 또렷하게 세웁니다. 실은 오리무파스 사시코실을 씁니다.
한 장에 15,000원이고, 네 장을 한 세트로 묶으면 50,000원입니다. 무늬와 장수는 메일로 알려주시면 그에 맞춰 놓습니다. 한 장은 15,000원이며, 네 장을 한 세트로 묶으면 50,000원입니다. 무늬와 장수는 메일로 알려주시면 그에 맞추어 놓습니다.
자주빛으로 물들인 천도 함께 만들었습니다. 같은 무늬라도 색이 바뀌면 다른 표정이 됩니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다. 자주빛으로 물들인 천도 함께 두었습니다. 같은 무늬라도 색이 바뀌면 다른 표정이 되며, 쓰고 난 뒤에는 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다. 장마다 실을 앉힌 자리가 조금씩 달라, 네 장을 나란히 두면 그 차이가 드러납니다.
@@ -0,0 +1,24 @@
---
slug: 2026-11-cherry-blossom-purple-linen
title: 자주색 위의 벚꽃
subtitle: 하프 린넨 한 장
date: 2026-11-01
price: ""
price_note: ""
sold_out: false
featured: false
image: assets/img/2026-11-cherry-blossom-purple-linen/cover.jpg
image_alt: 자주색 하프 린넨 위에 흰 실로 벚꽃과 작은 사각형을 놓은 자수 천의 앞면
gallery:
- assets/img/2026-11-cherry-blossom-purple-linen/detail-01.jpg
- assets/img/2026-11-cherry-blossom-purple-linen/detail-02.jpg
material: 11수 코튼린넨(국내산) · 사시코 전용실
size: 10 × 10 cm (한 장)
care: 미지근한 물에 중성세제로 단독 손세탁
naver_url: ""
---
자주색 하프 린넨 위에 흰 실로 벚꽃을 앉혔습니다. 꽃무늬 사이사이로 작은 사각형이 번갈아 놓여, 무늬의 간격을 잡습니다.
앞면과 뒷면은 같은 원단으로 맞추었습니다. 뒤집어 들어도 바탕의 색과 결이 그대로 이어집니다.
자수는 천 위에 실이 앉은 만큼만 두께를 냅니다. 자주색 바탕과 흰 실의 대비가 무늬의 윤곽을 이룹니다. 꽃잎을 따라 실을 앉힌 자리는 손으로 만지면 조금 도톰합니다.
@@ -0,0 +1,25 @@
---
slug: 2026-11-copenhagen-embroidery
title: 코펜하겐, 천 위에 앉히다
subtitle: 이름을 수놓는 일
date: 2026-11-01
price: 98000
price_note: ""
sold_out: false
featured: false
image: assets/img/2026-11-copenhagen-embroidery/cover.jpg
image_alt: 천 위에 실올이 한 땀씩 앉은 코펜하겐 자수 작품을 담은 대표 사진.
gallery:
- assets/img/2026-11-copenhagen-embroidery/detail-01.jpg
- assets/img/2026-11-copenhagen-embroidery/detail-02.jpg
- assets/img/2026-11-copenhagen-embroidery/detail-03.jpg
material: 린넨 100%, 면사 자수
size: ""
care: ""
naver_url: ""
---
코펜하겐이라는 이름의 자수가 천 위에 앉았습니다. 이름 하나가 작품의 첫 문장이 되고, 그 아래로 실올이 한 땀씩 제자리를 찾아갑니다. 도시의 이름을 빌렸으나 완성되는 것은 손의 리듬입니다.
천의 결을 따라 바늘을 세우고, 실은 조이지 않고 놓아둡니다. 성급히 당기면 천이 울고, 알맞게 앉히면 표면이 고르게 정돈됩니다. 그 차이는 손이 먼저 알고 눈이 나중에 알아차립니다.
마지막 땀을 매듭지으면 실은 조용히 천에 눌러앉습니다. 창가의 빛이 비스듬히 들 때, 수놓인 자리의 두께가 손끝에 남는 하루입니다.
@@ -0,0 +1,21 @@
---
slug: 2026-11-magnolia-tea-mat
title: 목련 한 땀 티매트
subtitle: 봄볕에 널어둔 천
date: 2026-11-01
price: 58000
sold_out: false
featured: false
image: assets/img/2026-11-magnolia-tea-mat/cover.jpg
image_alt: 아이보리 린넨 위에 흰 실로 목련 가지를 놓은 티매트
gallery:
material: 린넨 100%, 면사 자수
size: 30 × 45 cm
care: 미지근한 물에 중성세제로 단독 손세탁
naver_url: ""
---
아이보리 린넨 한 폭을 넓게 펴고, 목련 한 가지를 놓았습니다. 꽃잎은 흰 실로, 가지는 회갈색 실로. 천과 실의 색이 가까워서 가까이에서야 무늬가 보입니다.
꽃잎마다 실의 방향을 바꿔 빛이 드는 쪽을 남겼습니다. 창가에 놓으면 오후에 무늬가 한 번 더 드러납니다.
가장자리는 손으로 접어 박음질하고 귀퉁이를 두 번 돌려 마무리했습니다. 완성까지 열흘 남짓 걸렸습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
@@ -0,0 +1,27 @@
---
slug: 2026-11-sashiko-coaster-blue
title: 파란 천 위의 흰 올
subtitle: 사시코 코스터
date: 2026-11-01
price: 15000
price_note: ""
sold_out: false
featured: false
image: assets/img/2026-11-sashiko-coaster-blue/cover.jpg
image_alt: 파란 천에 흰 실로 격자를 수놓은 코스터 위에 회색 머그컵이 놓인 모습.
gallery:
- assets/img/2026-11-sashiko-coaster-blue/detail-01.jpg
- assets/img/2026-11-sashiko-coaster-blue/detail-02.jpg
- assets/img/2026-11-sashiko-coaster-blue/detail-03.jpg
material: 11수 코튼린넨(국내산) · 사시코 전용실
size: 10 × 10 cm (한 장)
care: 미지근한 물에 중성세제로 단독 손세탁
naver_url: ""
---
파란 천 위에 흰 실이 한 땀씩 앉습니다. 일정한 간격으로 놓인 점선이 격자를 이루고, 그 사이로 천의 올이 고요히 비칩니다.
회색 머그컵을 그 위에 올려 두면, 검은 액체의 온기가 천을 지나 아래로 천천히 옮겨 갑니다. 컵과 탁자 사이에 겹을 하나 두는 일, 그 작은 거리에서 코스터의 쓰임이 시작됩니다.
사시코는 선을 긋는 일이라기보다 올 사이에 숨을 고르는 일에 가깝습니다. 바늘이 지나간 자리마다 실의 두께가 남고, 그 두께가 천의 여백을 조금씩 밀어냅니다.
오후의 빛이 파란 천 위를 지나면, 흰 실 높이만큼 짧은 그림자가 놓입니다.
@@ -20,14 +20,14 @@ size: 완성 10 × 10 cm × 4장 (±1 cm)
care: 자수 완성 전 다림질 금지 · 물세탁은 30분 담갔다 그늘 건조 care: 자수 완성 전 다림질 금지 · 물세탁은 30분 담갔다 그늘 건조
naver_url: "https://smartstore.naver.com/lalashopkr/products/13640131815" naver_url: "https://smartstore.naver.com/lalashopkr/products/13640131815"
--- ---
전사지가 없습니다. 도안이 원단 위에 미리 프린트되어 와서, 봉투를 열고 실을 꿰면 바로 첫 땀을 놓을 수 있습니다. 11수 코튼린넨 네 장과 사시코 전용실 한 타래가 함께 옵니다. 바늘과 설명서는 들어 있지 않습니다. 전사지가 없습니다. 도안이 원단 위에 이미 프린트되어 오므로, 봉투를 열어 실을 꿰면 곧바로 첫 땀을 놓으실 수 있습니다. 11수 코튼린넨 네 장과 사시코 전용실 한 타래가 함께 담겨 옵니다. 바늘과 설명서는 들어 있지 않습니다.
무늬는 네 가지입니다. 격자, 꽃, 육각, 지그재그. 한 장에 하나씩, 와인빛 천 위에 흰 도안이 찍혀 있습니다. 다 놓으면 손바닥만 한 티코스터 네 장이 됩니다. 뒷감도 같은 원단이라 안쪽까지 같은 색으로 마무리됩니다. 무늬는 격자, 꽃, 육각, 지그재그 네 가지입니다. 한 장에 하나씩, 와인빛 천 위에 흰 도안이 앉아 있습니다. 모두 놓으면 손바닥만 한 티코스터 네 장이 되고, 뒷감도 같은 원단이라 안쪽까지 같은 색으로 마무리됩니다. 네 장을 다 놓을 무렵이면 도안선보다 손의 리듬이 먼저 기억됩니다.
다림질은 마지막에 한 번만 하세요. 도안 위에 다리미를 대면 도안이 깔끔하게 지워집니다. 실수로 지웠다면 냉동실에 한 시간 두면 대부분 돌아오지만, 흰색 도안은 돌아오지 않습니다. 다림질은 마지막에 한 번만 하십시오. 도안 위에 다리미를 대면 도안이 깔끔하게 지워집니다. 실수로 지우셨다면 냉동실에 한 시간 두면 대부분 돌아오지만, 흰색 도안은 돌아오지 않습니다.
린넨은 물에 담그면 줄어듭니다. 물세탁할 작품이라면 30분 담갔다가 그늘에 말린 뒤에 수를 놓으세요. 린넨은 물에 담그면 줄어듭니다. 물세탁할 작품이라면 30분 담갔다가 그늘에 말린 뒤에 수를 놓으십시오.
이 상품은 주문을 받은 뒤 재단하고 프린팅해서 보냅니다. 그래서 발송까지 최대 일주일이 걸리고, 단순 변심으로는 교환·반품이 어렵습니다. 배송비는 3,400원이고 6만원 이상이면 무료입니다. 제주는 2,000원, 제주 외 도서지역은 4,000원이 더 붙습니다. 이 상품은 주문을 받은 뒤 재단하고 프린팅하여 보냅니다. 그래서 발송까지 최대 일주일이 걸리고, 단순 변심으로는 교환·반품이 어렵습니다. 배송비는 3,400원이며 6만원 이상이면 무료입니다. 제주는 2,000원, 제주 외 도서지역은 4,000원이 더 붙습니다.
도안과 촬영 사진의 저작권은 라라원단에 있습니다. 상업적인 사용은 삼가 주세요. 도안과 촬영 사진의 저작권은 라라원단에 있습니다. 상업적인 사용은 삼가 주십시오.
+13 -4
View File
@@ -9,7 +9,7 @@
"contact": { "contact": {
"email": "hello@hanttam.kr", "email": "hello@hanttam.kr",
"instagram": "", "instagram": "",
"kakao": "" "kakao": "https://pf.kakao.com/_VsLWX/friend"
}, },
"shop": { "shop": {
"kit_slug": "2026-10-kit-first-stitch", "kit_slug": "2026-10-kit-first-stitch",
@@ -31,7 +31,16 @@
"product_sort": "newest", "product_sort": "newest",
"footer_note": "사업자등록번호와 통신판매업 신고 번호는 추후 기재합니다.", "footer_note": "사업자등록번호와 통신판매업 신고 번호는 추후 기재합니다.",
"image_credits": [ "image_credits": [
{"title": "Japanese flat silk embroidery on leno-weave fabric", "author": "Ineffablebookkeeper", "license": "CC BY-SA 4.0"}, {
{"title": "Wrapping cloth (bojagi), Korea", "author": "Hiart", "license": "CC0"} "title": "Japanese flat silk embroidery on leno-weave fabric",
] "author": "Ineffablebookkeeper",
"license": "CC BY-SA 4.0"
},
{
"title": "Wrapping cloth (bojagi), Korea",
"author": "Hiart",
"license": "CC0"
}
],
"sold_works_note": "재고가 없는 작품입니다. 같은 무늬로 다시 만들 수 있어요 — 카톡으로 문의하시면 제작 일정과 값을 함께 알려 드립니다."
} }
+8 -10
View File
@@ -3,23 +3,21 @@ set -euo pipefail
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
REMOTE="admin@100.101.79.24" # 2026-11-27: 공개 사이트는 이 폴더의 dist/ 를 그대로 서빙한다.
REMOTE_DIR="/share/CACHEDEV8_DATA/web/www/teamat/" # umbrel 컨테이너 `web`(caddy :8082) → https://teamat.lala.dedyn.io/ , https://home.lala.dedyn.io/teamat/
SITE_URL="https://home.lala.dedyn.io/teamat/" # 서브패스(항상 유효) — 배포 성공 판정용 # (마운트: /Home/teamat/dist → 웹루트). 그래서 build 만 하면 즉시 반영되고,
SITE_URL2="https://teamat.lala.dedyn.io/" # 전용 도메인 — 인증서 발급 전에는 000 이 나올 수 있다 # QNAP 으로의 rsync 배포 단계는 폐지했다.
SITE_URL="https://home.lala.dedyn.io/teamat/"
SITE_URL2="https://teamat.lala.dedyn.io/"
python3 build.py python3 build.py
echo
echo "배포: ${REMOTE}:${REMOTE_DIR}"
rsync -az --delete dist/ "${REMOTE}:${REMOTE_DIR}"
status="$(curl -s -o /dev/null -w '%{http_code}' "$SITE_URL")" status="$(curl -s -o /dev/null -w '%{http_code}' "$SITE_URL")"
if [ "$status" != "200" ]; then if [ "$status" != "200" ]; then
echo "배포 후 확인 실패: ${SITE_URL} (HTTP ${status})" >&2 echo "확인 실패: ${SITE_URL} (HTTP ${status})" >&2
exit 1 exit 1
fi fi
status2="$(curl -s --max-time 15 -o /dev/null -w '%{http_code}' "$SITE_URL2" || true)" status2="$(curl -s --max-time 15 -o /dev/null -w '%{http_code}' "$SITE_URL2" || true)"
echo "배포 완료: ${SITE_URL} (HTTP ${status})" echo "반영 완료: ${SITE_URL} (HTTP ${status})"
echo "전용 도메인: ${SITE_URL2} (HTTP ${status2:-000})" echo "전용 도메인: ${SITE_URL2} (HTTP ${status2:-000})"
+51
View File
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# QNAP 에서 등록 서버(teamat-admin)를 띄운다. 컨테이너는 호스트 포트 8089 를 쓰고,
# Caddy 가 teamat-admin.lala.dedyn.io -> 100.101.79.24:8089 로 넘긴다.
#
# bash scripts/run-qnap.sh build # 이미지 빌드
# bash scripts/run-qnap.sh up # (재)시작
# bash scripts/run-qnap.sh down # 중지
# bash scripts/run-qnap.sh logs # 로그
set -euo pipefail
DOCKER="${DOCKER:-/share/CACHEDEV7_DATA/.qpkg/container-station/bin/docker}"
BASE="${BASE:-/share/CACHEDEV8_DATA/docker/teamat-admin}"
WEB_ROOT="${WEB_ROOT:-/share/CACHEDEV8_DATA/web/www/teamat}"
NAME="teamat-admin"
IMAGE="teamat-admin:1"
PORT="${PORT:-8089}"
case "${1:-up}" in
build)
cd "$BASE/repo"
"$DOCKER" build -f studio/Dockerfile.qnap -t "$IMAGE" .
;;
up)
"$DOCKER" rm -f "$NAME" >/dev/null 2>&1 || true
"$DOCKER" run -d --name "$NAME" --restart unless-stopped \
-p "127.0.0.1:$PORT:$PORT" \
-v "$BASE/repo":/repo \
-v "$BASE/config":/config \
-v "$BASE/data":/data \
-v "$WEB_ROOT":/web \
-v "$BASE/.gitconfig":/root/.gitconfig:ro \
-v "$BASE/.git-credentials":/root/.git-credentials \
-e TEAMAT_WEB_ROOT=/web \
-e TEAMAT_ARCHIVE=/data/photos \
-e TEAMAT_PUSH=1 \
-e TEAMAT_DEFAULT_PAGE=m \
"$IMAGE"
sleep 2
"$DOCKER" logs --tail 5 "$NAME" || true
;;
down)
"$DOCKER" rm -f "$NAME"
;;
logs)
"$DOCKER" logs --tail 60 "$NAME"
;;
*)
echo "사용법: bash scripts/run-qnap.sh [build|up|down|logs]" >&2
exit 1
;;
esac
+17
View File
@@ -0,0 +1,17 @@
# 한땀 작업실(QNAP) — 등록 서버 이미지
# 사진 축소·회전에 Pillow 를 쓰고, 커밋·푸시에 git 이 필요하다.
FROM python:3.12-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir pillow==11.3.0
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
TEAMAT_CONFIG_DIR=/config \
TEAMAT_DEFAULT_PAGE=m
WORKDIR /repo
EXPOSE 8089
CMD ["python3", "studio/server.py", "--port", "8089", "--host", "0.0.0.0"]
+407 -24
View File
@@ -63,7 +63,7 @@
.chip{padding:9px 12px;border:1px solid var(--line);background:var(--white); .chip{padding:9px 12px;border:1px solid var(--line);background:var(--white);
font-size:13px;cursor:pointer;color:var(--muted)} font-size:13px;cursor:pointer;color:var(--muted)}
.chip[aria-pressed=true]{border-color:var(--sage);background:#EEF0E9;color:var(--ink)} .chip[aria-pressed=true]{border-color:var(--sage);background:#EEF0E9;color:var(--ink)}
.bar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:rgba(246,242,234,.97); .bar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:30;background:rgba(246,242,234,.97);
border-top:1px solid var(--line);padding:12px 18px calc(12px + var(--safe-b)); border-top:1px solid var(--line);padding:12px 18px calc(12px + var(--safe-b));
display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:center} display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:center}
.bar .hint{font-size:12px;color:var(--muted);line-height:1.4} .bar .hint{font-size:12px;color:var(--muted);line-height:1.4}
@@ -75,6 +75,9 @@
.list-item{display:flex;justify-content:space-between;align-items:baseline;gap:10px; .list-item{display:flex;justify-content:space-between;align-items:baseline;gap:10px;
padding:13px 2px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink)} padding:13px 2px;border-bottom:1px solid var(--line);text-decoration:none;color:var(--ink)}
.list-item small{color:var(--muted)} .list-item small{color:var(--muted)}
.hist-item{align-items:center}
.hist-item span{flex:1;min-width:0;font-size:13px;line-height:1.5}
.hist-item button{flex:none;white-space:nowrap}
.status{font-size:13px;color:var(--muted);margin-top:10px;min-height:20px} .status{font-size:13px;color:var(--muted);margin-top:10px;min-height:20px}
.status.err{color:#9B3B2A} .status.err{color:#9B3B2A}
.toast{position:fixed;left:50%;bottom:calc(110px + var(--safe-b));transform:translateX(-50%); .toast{position:fixed;left:50%;bottom:calc(110px + var(--safe-b));transform:translateX(-50%);
@@ -87,6 +90,20 @@
.summary{font-size:14px;color:var(--muted);margin-bottom:14px} .summary{font-size:14px;color:var(--muted);margin-bottom:14px}
.summary b{color:var(--ink);font-weight:500} .summary b{color:var(--ink);font-weight:500}
a.live{color:var(--sage)} a.live{color:var(--sage)}
.work-card{display:block;position:relative;padding:10px 0;border-bottom:1px solid var(--line)}
.work-open{display:grid;grid-template-columns:88px 1fr;gap:12px;align-items:center;
text-decoration:none;color:var(--ink);padding-right:64px}
.work-open img{width:88px;aspect-ratio:4/5;object-fit:cover;background:var(--line);display:block}
.work-meta{display:grid;gap:3px;min-width:0}
.work-meta strong{font-weight:500;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.work-meta span{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.work-meta .price{color:var(--ink);font-size:13px}
.edit-btn{position:absolute;right:0;bottom:12px;border:1px solid var(--line);background:var(--white);
color:var(--ink);font-size:13px;padding:8px 12px;cursor:pointer}
.danger-zone{margin-top:28px;padding-top:18px;border-top:1px solid var(--line)}
.btn.danger{background:var(--clay);border-color:var(--clay);color:#fff}
.new-badge{position:absolute;right:0;top:10px;background:var(--sage);color:#fff;
font-size:10px;letter-spacing:.08em;padding:3px 6px}
</style> </style>
</head> </head>
<body> <body>
@@ -98,15 +115,23 @@
</header> </header>
<main> <main>
<!-- ① 홈 --> <!-- ① 홈: 작품 목록 -->
<section id="s-home"> <section id="s-home">
<p class="label">ADD PRODUCT</p> <p class="label">WORKS</p>
<h1>새 작품을 등록합니다</h1> <h1>작품 목록</h1>
<p class="note">사진을 찍고, 내용을 쓰고, 항목을 고르면 상세 페이지 한 장이 만들어집니다.</p> <p class="note" id="home-note">불러오는 중…</p>
<button class="btn" id="start">신규 상품 등록</button> <button class="btn" id="start">신규 상품 등록</button>
<div style="margin-top:26px"> <div style="height:10px"></div>
<p class="label">최근 작품</p> <button class="btn ghost" id="deploy-all">사이트에 올리기</button>
<div id="home-list"><span class="status"><span class="spin"></span> 불러오는 중</span></div> <div class="status" id="deploy-status"></div>
<div id="home-list" style="margin-top:16px">
<span class="status"><span class="spin"></span> 불러오는 중</span>
</div>
<div style="margin-top:24px">
<p class="label">UNDO</p>
<button class="btn ghost btn-sm" id="hist-toggle" style="width:100%">최근 이력 · 되돌리기</button>
<div id="hist-list" hidden style="margin-top:10px"></div>
</div> </div>
</section> </section>
@@ -135,6 +160,8 @@
<textarea id="note" style="min-height:84px" placeholder="예: 와인색 코튼린넨, 네 장, 사시코 실 포함"></textarea> <textarea id="note" style="min-height:84px" placeholder="예: 와인색 코튼린넨, 네 장, 사시코 실 포함"></textarea>
</label> </label>
<div class="chips"><button class="voice" id="voice">🎙 말로 적기</button></div> <div class="chips"><button class="voice" id="voice">🎙 말로 적기</button></div>
<p class="label" style="margin-top:6px">어투</p>
<div class="chips" id="tone-new"></div>
<button class="btn sage" id="cap">내용 작성</button> <button class="btn sage" id="cap">내용 작성</button>
<div class="status" id="cap-status"></div> <div class="status" id="cap-status"></div>
<div id="cap-out" hidden style="margin-top:18px"> <div id="cap-out" hidden style="margin-top:18px">
@@ -191,6 +218,83 @@
<span style="margin:0">다른 초안도 함께 올리기</span> <span style="margin:0">다른 초안도 함께 올리기</span>
</label> </label>
<div class="status" id="pub-status"></div> <div class="status" id="pub-status"></div>
<div class="stack" id="after-publish" hidden style="margin-top:16px">
<button class="btn sage" id="to-list">목록으로 돌아가기</button>
<a class="btn ghost" id="open-preview" href="#" target="_blank" rel="noopener">이 작품 페이지 열기</a>
<a class="btn ghost" id="open-live" href="#" target="_blank" rel="noopener" hidden>사이트에서 보기</a>
</div>
</section>
<!-- ⑥ 고치기 -->
<section id="s-edit" hidden>
<p class="label">EDIT</p>
<h1 id="edit-head">작품 고치기</h1>
<p class="note" id="edit-slug"></p>
<p class="label">사진</p>
<div class="thumbs" id="edit-thumbs"></div>
<div class="row2">
<button class="btn ghost" id="edit-shoot">사진 찍어 추가</button>
<a class="btn ghost" id="edit-open" href="#" target="_blank" rel="noopener">페이지 열기</a>
</div>
<button class="btn ghost btn-sm" id="edit-album-btn" style="width:100%;margin-top:8px">앨범에서 추가</button>
<input type="file" id="edit-cam" accept="image/*" capture="environment" hidden>
<input type="file" id="edit-album" accept="image/*" multiple hidden>
<div class="status" id="edit-up"></div>
<div style="margin-top:18px">
<label class="field"><span>제목</span><input type="text" id="e-title"></label>
<label class="field"><span>부제</span><input type="text" id="e-subtitle"></label>
<label class="field"><span>본문</span><textarea id="e-body" style="min-height:220px"></textarea></label>
<label class="field"><span>사진 설명(alt)</span><input type="text" id="e-alt"></label>
<label class="field"><span>규격</span><input type="text" id="e-size"></label>
<div class="chips" data-for="e-size"></div>
<label class="field"><span>소재</span><input type="text" id="e-material"></label>
<div class="chips" data-for="e-material"></div>
<label class="field"><span>세탁</span><input type="text" id="e-care"></label>
<div class="chips" data-for="e-care"></div>
<div class="row2">
<label class="field"><span>가격(원)</span><input type="number" id="e-price" inputmode="numeric"></label>
<label class="field"><span>날짜</span><input type="date" id="e-date"></label>
</div>
<label class="field"><span>가격 옵션 안내</span><input type="text" id="e-pricenote"></label>
<label class="field"><span>네이버 링크</span><input type="url" id="e-naver"></label>
<label class="field" style="display:flex;gap:10px;align-items:center">
<input type="checkbox" id="e-featured" style="width:20px;height:20px"><span style="margin:0">첫 페이지 대표작으로</span>
</label>
<label class="field" style="display:flex;gap:10px;align-items:center">
<input type="checkbox" id="e-soldout" style="width:20px;height:20px"><span style="margin:0">품절 표시</span>
</label>
</div>
<p class="label" style="margin-top:22px">본문 어투 바꾸기</p>
<div class="chips" id="tone-edit"></div>
<button class="btn ghost" id="e-rewrite">이 어투로 다시 쓰기</button>
<div class="status" id="rewrite-status"></div>
<div id="rewrite-box" hidden style="margin-top:12px">
<p class="label">새 본문 (아직 저장 안 됨)</p>
<pre class="facts" id="rewrite-text" style="max-height:300px;overflow:auto"></pre>
<div class="row2">
<button class="btn" id="rewrite-apply">본문에 적용</button>
<button class="btn ghost" id="rewrite-discard">버리기</button>
</div>
</div>
<div style="height:14px"></div>
<button class="btn sage" id="e-save">저장하고 사이트에 올리기</button>
<div style="height:10px"></div>
<button class="btn ghost" id="e-save-only">저장만</button>
<div style="height:10px"></div>
<button class="btn ghost" id="e-cancel">목록으로</button>
<div class="status" id="e-status"></div>
<div class="danger-zone">
<p class="label">DELETE</p>
<p class="note">지우면 목록과 상세 페이지에서 사라집니다. 찍은 원본 사진은 보관함에 남고, 이력에서 되돌리면 복구됩니다.</p>
<button class="btn danger" id="e-delete">이 작품 삭제</button>
</div>
</section> </section>
</main> </main>
@@ -201,7 +305,8 @@
<div class="toast" id="toast"></div> <div class="toast" id="toast"></div>
<script> <script>
const S = { step:'home', photos:[], facts:'', draft:{}, busy:false, presets:null }; const S = { step:'home', photos:[], facts:'', draft:{}, busy:false, presets:null,
tone:'warm', editTone:'warm', rewrite:'' };
const $ = s => document.querySelector(s); const $ = s => document.querySelector(s);
const toast = (m, ms=2200) => { const t=$('#toast'); t.textContent=m; t.classList.add('on'); const toast = (m, ms=2200) => { const t=$('#toast'); t.textContent=m; t.classList.add('on');
@@ -219,11 +324,12 @@ async function api(path, body){
/* ---------- 단계 이동 ---------- */ /* ---------- 단계 이동 ---------- */
const STEPS = { const STEPS = {
home:{el:'#s-home', n:'등록', prev:null, next:null}, home:{el:'#s-home', n:'', prev:null, next:null},
photos:{el:'#s-photos', n:'1/4 사진', prev:'home', next:'write'}, photos:{el:'#s-photos', n:'1/4 사진', prev:'home', next:'write'},
write:{el:'#s-write', n:'2/4 내용', prev:'photos', next:'specs'}, write:{el:'#s-write', n:'2/4 내용', prev:'photos', next:'specs'},
specs:{el:'#s-specs', n:'3/4 항목', prev:'write', next:'done'}, specs:{el:'#s-specs', n:'3/4 항목', prev:'write', next:'done'},
done:{el:'#s-done', n:'4/4 저장', prev:'specs', next:null}, done:{el:'#s-done', n:'4/4 저장', prev:'specs', next:null},
edit:{el:'#s-edit', n:'고치기', prev:null, next:null},
}; };
function go(step){ function go(step){
S.step = step; S.step = step;
@@ -231,12 +337,13 @@ function go(step){
$(STEPS[step].el).hidden = false; $(STEPS[step].el).hidden = false;
$('#steps').textContent = STEPS[step].n; $('#steps').textContent = STEPS[step].n;
const cfg = STEPS[step]; const cfg = STEPS[step];
$('#bar').style.display = step==='home' ? 'none' : 'grid'; $('#bar').style.display = (step==='home' || step==='edit') ? 'none' : 'grid';
$('#back').style.visibility = cfg.prev ? 'visible' : 'hidden'; $('#back').style.visibility = cfg.prev ? 'visible' : 'hidden';
const next = $('#next'); const next = $('#next');
next.textContent = step==='specs' ? '확인' : '다음'; next.textContent = step==='specs' ? '확인' : '다음';
next.style.display = cfg.next ? '' : 'none'; next.style.display = cfg.next ? '' : 'none';
if (step==='done') renderSummary(); if (step==='done') renderSummary();
if (step==='home') loadHome();
window.scrollTo({top:0}); window.scrollTo({top:0});
} }
$('#back').onclick = () => { const p = STEPS[S.step].prev; if (p) go(p); }; $('#back').onclick = () => { const p = STEPS[S.step].prev; if (p) go(p); };
@@ -249,20 +356,47 @@ $('#next').onclick = () => {
go(STEPS[S.step].next); go(STEPS[S.step].next);
}; };
/* ---------- 홈 ---------- */ /* ---------- 홈: 작품 목록 ---------- */
async function loadHome(){ async function loadHome(){
try{ try{
const d = await api('/api/state'); const d = await api('/api/state');
const rows = d.products.slice(0,8).map(p => S.site = d.site_url || '';
`<a class="list-item" href="/p/${p.slug}.html" target="_blank"> const rows = (d.products || []).slice().sort((a,b) =>
<span>${p.title}</span><small>${p.price_text||''}</small></a>`).join(''); String(b.date||'').localeCompare(String(a.date||'')) || (b.mtime||0)-(a.mtime||0));
$('#home-list').innerHTML = rows || '<span class="status">아직 등록된 작품이 없습니다</span>'; $('#home-note').textContent = rows.length
if (d.presets || (d.vision)) {} ? rows.length + '점 · 최근에 만든 순서입니다. 눌러서 확인하세요.'
}catch(e){ $('#home-list').innerHTML = `<span class="status err">${e.message}</span>`; } : '아직 등록한 작품이 없습니다.';
$('#home-list').innerHTML = rows.map(p => `
<div class="work-card">
<a class="work-open" href="/p/${p.slug}.html" target="_blank" rel="noopener">
${p.image ? `<img src="/${p.image}" alt="" loading="lazy">` : '<span></span>'}
<div class="work-meta">
<strong>${p.title}</strong>
<span>${p.subtitle || ''}</span>
<span class="price">${p.price ? Number(p.price).toLocaleString('ko-KR') + '원' : '가격 문의'}${p.sold_out ? ' · 판매 완료' : ''}</span>
</div>
</a>
<button class="edit-btn" data-slug="${p.slug}">수정</button>
${S.lastSlug === p.slug ? '<span class="new-badge">방금 등록</span>'
: (p.live === false ? '<span class="new-badge" style="background:var(--clay)">미발행</span>' : '')}
</div>`).join('') || '<p class="note">아직 없습니다.</p>';
document.querySelectorAll('.edit-btn').forEach(b => b.onclick = () => openEdit(b.dataset.slug));
const pending = rows.filter(p => p.live === false).length;
const button = $('#deploy-all');
button.disabled = pending === 0;
button.style.display = pending ? 'flex' : 'none';
button.textContent = pending ? `사이트에 올리기 (미발행 ${pending}점)` : '사이트 최신 상태';
}catch(e){
$('#home-note').textContent = '';
$('#home-list').innerHTML = `<span class="status err">${e.message}</span>`;
}
} }
$('#start').onclick = () => { $('#start').onclick = () => {
S.photos = []; S.facts=''; S.draft={}; S.photos = []; S.facts=''; S.draft={}; S.lastSlug = null;
$('#after-publish').hidden = true; $('#pub-status').textContent = '';
['#f-title','#f-subtitle','#f-body','#f-alt','#f-size','#f-material','#f-care','#f-price', ['#f-title','#f-subtitle','#f-body','#f-alt','#f-size','#f-material','#f-care','#f-price',
'#f-pricenote','#f-naver','#note'].forEach(s=>{ if($(s)) $(s).value=''; }); '#f-pricenote','#f-naver','#note'].forEach(s=>{ if($(s)) $(s).value=''; });
$('#f-date').value = new Date().toISOString().slice(0,10); $('#f-date').value = new Date().toISOString().slice(0,10);
@@ -325,6 +459,7 @@ $('#cap').onclick = async () => {
$('#cap-status').innerHTML = '<span class="spin"></span> 사진을 읽고 문장을 쓰는 중… (10~30초)'; $('#cap-status').innerHTML = '<span class="spin"></span> 사진을 읽고 문장을 쓰는 중… (10~30초)';
try{ try{
const d = await api('/api/caption', { const d = await api('/api/caption', {
tone: S.tone,
photos: S.photos.map(p=>p.uid), photos: S.photos.map(p=>p.uid),
note: $('#note').value.trim(), note: $('#note').value.trim(),
known: { size:$('#f-size').value.trim(), material:$('#f-material').value.trim(), known: { size:$('#f-size').value.trim(), material:$('#f-material').value.trim(),
@@ -363,10 +498,12 @@ const SR = window.SpeechRecognition || window.webkitSpeechRecognition;
async function loadPresets(){ async function loadPresets(){
try{ try{
const d = await api('/api/presets'); const d = await api('/api/presets');
S.presets = d.presets; S.presets = { ...d.presets, tones: d.tones || [] };
S.defaultTone = d.default_tone || 'warm';
document.querySelectorAll('.chips[data-for]').forEach(box=>{ document.querySelectorAll('.chips[data-for]').forEach(box=>{
const key = box.dataset.for === 'f-size' ? 'size' const target = box.dataset.for;
: box.dataset.for === 'f-material' ? 'material' : 'care'; const key = target.endsWith('size') ? 'size'
: target.endsWith('material') ? 'material' : 'care';
box.innerHTML = (d.presets[key]||[]).map(v=>`<button class="chip">${v}</button>`).join(''); box.innerHTML = (d.presets[key]||[]).map(v=>`<button class="chip">${v}</button>`).join('');
box.querySelectorAll('.chip').forEach(ch=>ch.onclick=()=>{ box.querySelectorAll('.chip').forEach(ch=>ch.onclick=()=>{
box.querySelectorAll('.chip').forEach(c=>c.setAttribute('aria-pressed','false')); box.querySelectorAll('.chip').forEach(c=>c.setAttribute('aria-pressed','false'));
@@ -374,6 +511,9 @@ async function loadPresets(){
$('#'+box.dataset.for).value = ch.textContent; $('#'+box.dataset.for).value = ch.textContent;
}); });
}); });
S.tone = d.default_tone || 'warm';
S.editTone = S.tone;
paintTones();
}catch(e){ toast(e.message); } }catch(e){ toast(e.message); }
} }
@@ -418,10 +558,15 @@ async function doPublish(deploy){
const d = await api('/api/publish', Object.assign(payload(), {deploy})); const d = await api('/api/publish', Object.assign(payload(), {deploy}));
const tail = d.deployed ? '사이트에 올렸습니다. ' const tail = d.deployed ? '사이트에 올렸습니다. '
: (deploy ? '저장은 했지만 배포하지 못했습니다.<br><span class="err">' + (d.deploy_log||'') + '</span>' : (deploy ? '저장은 했지만 배포하지 못했습니다.<br><span class="err">' + (d.deploy_log||'') + '</span>'
: '배포는 하지 않았습니다. '); : '저장했습니다. 사이트에는 아직 안 올라갔습니다 — 목록에서 [사이트에 올리기]를 누르세요.');
$('#pub-status').innerHTML = $('#pub-status').innerHTML =
`저장했습니다 — <b>${d.slug}</b> · 커밋 ${String(d.commit).slice(0,40)}<br>` + tail + `저장했습니다 — <b>${d.slug}</b> · 커밋 ${String(d.commit).slice(0,40)}<br>` + tail +
`<a class="live" href="${d.url}" target="_blank">상세 페이지 열기</a>`; `<a class="live" href="${d.url}" target="_blank">상세 페이지 열기</a>`;
S.lastSlug = d.slug;
$('#open-preview').href = d.url;
const live = $('#open-live');
if (d.deployed && d.live_url) { live.href = d.live_url; live.hidden = false; } else { live.hidden = true; }
$('#after-publish').hidden = false;
toast('등록 완료'); toast('등록 완료');
loadHome(); loadHome();
}catch(e){ $('#pub-status').innerHTML = `<span class="status err">${e.message}</span>`; } }catch(e){ $('#pub-status').innerHTML = `<span class="status err">${e.message}</span>`; }
@@ -429,9 +574,247 @@ async function doPublish(deploy){
} }
$('#pub-deploy').onclick = () => doPublish(true); $('#pub-deploy').onclick = () => doPublish(true);
$('#pub-only').onclick = () => doPublish(false); $('#pub-only').onclick = () => doPublish(false);
$('#to-list').onclick = () => go('home');
document.querySelector('.brand').onclick = () => go('home');
/* ---------- 사이트에 올리기(배포만) ---------- */
$('#deploy-all').onclick = async () => {
const status = $('#deploy-status');
const run = async (force) => {
status.innerHTML = '<span class="spin"></span> 사이트에 올리는 중…';
try{
const d = await api('/api/deploy', {force});
status.innerHTML = d.ok ? '올렸습니다. ' + (d.log||'').split('\n').pop() : `<span class="err">${d.log||'실패'}</span>`;
toast('사이트에 올렸습니다');
loadHome();
return true;
}catch(e){
if (String(e.message).includes('초안')){
if (confirm(e.message + '\n\n그 초안까지 함께 올릴까요?')) return run(true);
status.textContent = '취소했습니다';
return true;
}
status.innerHTML = `<span class="status err">${e.message}</span>`;
return false;
}
};
await run(false);
};
/* ---------- 어투 칩 ---------- */
function paintTones(){
const tones = (S.presets && S.presets.tones) || [];
const fill = (sel, current, onPick) => {
const box = $(sel);
if (!box) return;
box.innerHTML = tones.map(t => `<button class="chip" data-tone="${t.key}"
aria-pressed="${t.key === current ? 'true' : 'false'}">${t.label}</button>`).join('');
box.querySelectorAll('.chip').forEach(ch => ch.onclick = () => onPick(ch.dataset.tone));
};
fill('#tone-new', S.tone, key => { S.tone = key; paintTones(); });
fill('#tone-edit', S.editTone, key => { S.editTone = key; paintTones(); $('#rewrite-box').hidden = true; });
}
/* ---------- 고치기 ---------- */
async function openEdit(slug){
$('#e-status').textContent = ''; $('#edit-up').textContent = '';
try{
const d = await api('/api/product?slug=' + encodeURIComponent(slug));
const p = d.product, f = p.fields || {};
const gallery = Array.isArray(f.gallery)
? f.gallery
: String(f.gallery || '').split('\n').map(s => s.trim()).filter(Boolean);
S.edit = { slug, images: [f.image, ...gallery].filter(Boolean).map(path => ({ path })) };
$('#edit-head').textContent = f.title || '작품 고치기';
$('#edit-slug').textContent = slug;
$('#edit-open').href = '/p/' + slug + '.html';
$('#e-title').value = f.title || '';
$('#e-subtitle').value = f.subtitle || '';
$('#e-body').value = p.body || '';
$('#e-alt').value = f.image_alt || '';
$('#e-size').value = f.size || '';
$('#e-material').value = f.material || '';
$('#e-care').value = f.care || '';
$('#e-price').value = f.price || '';
$('#e-pricenote').value = f.price_note || '';
$('#e-date').value = String(f.date || '').slice(0,10);
$('#e-naver').value = f.naver_url || '';
$('#e-featured').checked = !!f.featured;
$('#e-soldout').checked = !!f.sold_out;
renderEditThumbs();
go('edit');
}catch(e){ toast(e.message); }
}
function renderEditThumbs(){
const box = $('#edit-thumbs');
const imgs = (S.edit && S.edit.images) || [];
if (!imgs.length){ box.innerHTML = '<p class="note" style="grid-column:1/-1">사진이 없습니다. 한 장은 있어야 합니다.</p>'; return; }
box.innerHTML = imgs.map((p,i)=>`
<div class="thumb">
<img src="${p.uid ? '/media-inbox/' + p.uid + '.jpg' : '/' + p.path}" alt="">
${i===0?'<span class="badge">대표</span>':''}
<div class="tools">
${i>0?`<button data-mvn="${i}:-1" aria-label="앞으로">←</button>`:''}
${i<imgs.length-1?`<button data-mvn="${i}:1" aria-label="뒤로">→</button>`:''}
<button class="del" data-deln="${i}" aria-label="삭제">×</button>
</div>
</div>`).join('');
box.querySelectorAll('[data-deln]').forEach(b=>b.onclick=()=>{
S.edit.images.splice(+b.dataset.deln,1); renderEditThumbs();
});
box.querySelectorAll('[data-mvn]').forEach(b=>b.onclick=()=>{
const [i,dv] = b.dataset.mvn.split(':').map(Number);
const j = i + dv; if (j < 0 || j >= S.edit.images.length) return;
[S.edit.images[i], S.edit.images[j]] = [S.edit.images[j], S.edit.images[i]];
renderEditThumbs();
});
}
$('#edit-shoot').onclick = () => $('#edit-cam').click();
$('#edit-album-btn').onclick = () => $('#edit-album').click();
$('#edit-cam').onchange = e => uploadEditFiles(e.target.files);
$('#edit-album').onchange = e => uploadEditFiles(e.target.files);
async function uploadEditFiles(files){
const list = Array.from(files || []);
if (!list.length) return;
for (let i=0;i<list.length;i++){
$('#edit-up').innerHTML = `<span class="spin"></span> 사진 올리는 중 ${i+1}/${list.length}`;
try{
const res = await fetch('/api/photo?name=' + encodeURIComponent(list[i].name || 'photo.jpg'),
{method:'POST', headers:{'Content-Type':'application/octet-stream'}, body:list[i]});
const d = await res.json();
if (!res.ok || d.ok === false) throw new Error(d.error || '업로드 실패');
S.edit.images.push({ uid: d.uid });
}catch(e){ $('#edit-up').innerHTML = `<span class="status err">${e.message}</span>`; return; }
}
$('#edit-up').textContent = '';
$('#edit-cam').value = ''; $('#edit-album').value = '';
renderEditThumbs();
}
async function saveEdit(deploy){
const s = $('#e-status');
if (!$('#e-title').value.trim()){ s.innerHTML = '<span class="err">제목을 넣어 주세요</span>'; return; }
if (!S.edit || !S.edit.images.length){ s.innerHTML = '<span class="err">사진이 최소 한 장 필요합니다</span>'; return; }
['#e-save','#e-save-only'].forEach(x=>$(x).disabled=true);
s.innerHTML = '<span class="spin"></span> 저장 중… (사진 정리 → 빌드 → 커밋' + (deploy?' → 배포':'') + ')';
try{
const d = await api('/api/update', {
slug: S.edit.slug, images: S.edit.images,
title: $('#e-title').value.trim(), subtitle: $('#e-subtitle').value.trim(),
body: $('#e-body').value, image_alt: $('#e-alt').value.trim(),
size: $('#e-size').value.trim(), material: $('#e-material').value.trim(),
care: $('#e-care').value.trim(), price: $('#e-price').value, price_note: $('#e-pricenote').value.trim(),
date: $('#e-date').value, naver_url: $('#e-naver').value.trim(),
featured: $('#e-featured').checked, sold_out: $('#e-soldout').checked, deploy
});
s.innerHTML = `고쳤습니다 — 커밋 ${String(d.commit).slice(0,34)}<br>` +
(d.deployed ? '사이트에 올렸습니다. ' : '저장만 했습니다. ') +
`<a class="live" href="${d.url}" target="_blank">페이지 열기</a>`;
toast('수정 완료');
S.lastSlug = d.slug;
}catch(e){ s.innerHTML = `<span class="status err">${e.message}</span>`; }
finally{ ['#e-save','#e-save-only'].forEach(x=>$(x).disabled=false); }
}
$('#e-rewrite').onclick = async () => {
if (!S.edit){ return; }
const st = $('#rewrite-status');
st.innerHTML = '<span class="spin"></span> 문장을 다시 쓰는 중… (10초 안팎)';
try{
const d = await api('/api/tone', { slug: S.edit.slug, tone: S.editTone });
S.rewrite = d.body;
$('#rewrite-text').textContent = d.body;
$('#rewrite-box').hidden = false;
st.textContent = `${d.tone_label} 어투로 다시 썼습니다. 본문에 적용할지 정해 주세요.`;
}catch(e){ st.innerHTML = `<span class="status err">${e.message}</span>`; }
};
$('#rewrite-apply').onclick = () => {
if (!S.rewrite) return;
$('#e-body').value = S.rewrite;
$('#rewrite-box').hidden = true;
$('#rewrite-status').textContent = '본문에 넣었습니다. 저장을 눌러야 반영됩니다.';
toast('본문에 적용');
};
$('#rewrite-discard').onclick = () => {
S.rewrite = ''; $('#rewrite-box').hidden = true; $('#rewrite-status').textContent = '버렸습니다';
};
$('#e-save').onclick = () => saveEdit(true);
$('#e-save-only').onclick = () => saveEdit(false);
$('#e-cancel').onclick = () => go('home');
/* ---------- 삭제 ---------- */
async function deleteWork(force){
if (!S.edit) return;
const slug = S.edit.slug;
const title = $('#e-title').value.trim() || slug;
const st = $('#e-status');
$('#e-delete').disabled = true;
st.innerHTML = '<span class="spin"></span> 지우는 중… (빌드 → 커밋 → 사이트 반영)';
try{
const d = await api('/api/delete', { slug, deploy:true, force: !!force });
const note = d.deployed
? '사이트에서도 내렸습니다.'
: (d.deploy_log || '저장소에서만 지웠습니다 — 사이트에는 아직 남아 있습니다.');
toast('삭제 완료');
go('home');
$('#deploy-status').innerHTML = `삭제했습니다 — <b>${d.title}</b> · 커밋 ${String(d.commit).slice(0,34)}<br>${note}`;
}catch(e){
st.innerHTML = `<span class="status err">${e.message}</span>`;
toast(e.message, 4000);
}finally{ $('#e-delete').disabled = false; }
}
$('#e-delete').onclick = async () => {
if (!S.edit) return;
const title = $('#e-title').value.trim() || S.edit.slug;
const ok = confirm(`"${title}"을(를) 지울까요?\n\n목록과 상세 페이지에서 사라집니다.\n나중에 이력에서 되돌리면 그대로 살아납니다.`);
if (!ok) return;
await deleteWork(false);
};
/* ---------- 최근 이력 · 되돌리기 ---------- */
$('#hist-toggle').onclick = async () => {
const box = $('#hist-list');
if (!box.hidden){ box.hidden = true; return; }
box.hidden = false;
box.innerHTML = '<span class="status"><span class="spin"></span> 불러오는 중</span>';
try{
const d = await api('/api/history');
box.innerHTML = (d.history || []).map(h => `
<div class="list-item hist-item">
<span>${h.date} · ${h.subject}</span>
<button class="btn ghost btn-sm" data-undo="${h.sha}">되돌리기</button>
</div>`).join('') || '<p class="note">이력이 없습니다.</p>';
box.querySelectorAll('[data-undo]').forEach(b => b.onclick = () => undoCommit(b.dataset.undo, b));
}catch(e){ box.innerHTML = `<span class="status err">${e.message}</span>`; }
};
async function undoCommit(sha, btn){
if (!confirm(`${sha} 커밋을 되돌릴까요?\n\n지운 작품을 되살릴 때 이 버튼을 씁니다. 되돌리기도 새 커밋으로 남습니다.`)) return;
const box = $('#hist-list');
if (btn) btn.disabled = true;
box.innerHTML = '<span class="status"><span class="spin"></span> 되돌리는 중…</span>';
try{
const d = await api('/api/revert', { sha, deploy:true });
const note = d.deployed ? '사이트에도 반영했습니다.'
: (d.deploy_log || '저장소에서만 되돌렸습니다 — 사이트에는 아직 옛 상태입니다.');
box.hidden = true; box.innerHTML = '';
toast('되돌렸습니다');
go('home');
$('#deploy-status').innerHTML = `${sha} 되돌렸습니다 · 커밋 ${String(d.head || '').slice(0,34)}<br>${note}`;
}catch(e){
box.innerHTML = `<span class="status err">${e.message}</span>`;
if (btn) btn.disabled = false;
}
}
/* ---------- 시작 ---------- */ /* ---------- 시작 ---------- */
loadHome(); loadPresets(); go('home'); loadPresets();
// 목록의 링크나 알림에서 바로 열 수 있게: /m?slug=<슬러그> → 그 작품 고치기 화면
const deepSlug = new URLSearchParams(location.search).get('slug');
if (deepSlug) openEdit(deepSlug);
</script> </script>
</body> </body>
</html> </html>
+81 -11
View File
@@ -11,6 +11,7 @@ studio/server.py 가 import 해서 쓴다. 표준 라이브러리 + macOS 기본
from __future__ import annotations from __future__ import annotations
import base64 import base64
import io
import json import json
import os import os
import re import re
@@ -25,13 +26,21 @@ from datetime import datetime
from pathlib import Path from pathlib import Path
from typing import Any, Dict, List, Tuple from typing import Any, Dict, List, Tuple
try: # 리눅스(QNAP 컨테이너)에서는 Pillow, macOS 기본 파이썬에는 없음
from PIL import Image, ImageOps
HAS_PIL = True
except ImportError: # pragma: no cover - macOS 폴백
HAS_PIL = False
BASE = Path(__file__).resolve().parent BASE = Path(__file__).resolve().parent
ROOT = BASE.parent ROOT = BASE.parent
PRODUCTS = ROOT / "content" / "products" PRODUCTS = ROOT / "content" / "products"
ASSETS = ROOT / "assets" ASSETS = ROOT / "assets"
INBOX = BASE / "_inbox" INBOX = BASE / "_inbox"
ARCHIVE = Path(os.environ.get("TEAMAT_ARCHIVE") or (BASE / "_archive"))
CONFIG_DIR = Path.home() / ".config" / "teamat-studio" CONFIG_DIR = Path(os.environ.get("TEAMAT_CONFIG_DIR") or (Path.home() / ".config" / "teamat-studio"))
AI_CONFIG = CONFIG_DIR / "ai.json" AI_CONFIG = CONFIG_DIR / "ai.json"
VISION_CONFIG = CONFIG_DIR / "vision.json" VISION_CONFIG = CONFIG_DIR / "vision.json"
AI_BASE_URL = "https://api.deepseek.com/v1" AI_BASE_URL = "https://api.deepseek.com/v1"
@@ -122,7 +131,14 @@ def vision_status() -> Dict[str, Any]:
def _shrink(path: Path, limit: int = 900) -> bytes: def _shrink(path: Path, limit: int = 900) -> bytes:
"""VLM 에 보낼 용량 줄이기. sips 는 macOS 기본 도구.""" """VLM 에 보낼 용량 줄이기. Pillow(리눅스) 또는 sips(macOS)."""
if HAS_PIL:
with Image.open(path) as image:
image = ImageOps.exif_transpose(image).convert("RGB")
image.thumbnail((limit, limit), Image.LANCZOS)
buffer = io.BytesIO()
image.save(buffer, format="JPEG", quality=75, optimize=True)
return buffer.getvalue()
tmp = INBOX / (path.stem + f"-v{limit}.jpg") tmp = INBOX / (path.stem + f"-v{limit}.jpg")
ok = subprocess.run(["sips", "-Z", str(limit), "-s", "format", "jpeg", ok = subprocess.run(["sips", "-Z", str(limit), "-s", "format", "jpeg",
"-s", "formatOptions", "75", str(path), "--out", str(tmp)], "-s", "formatOptions", "75", str(path), "--out", str(tmp)],
@@ -174,10 +190,38 @@ def photo_facts(uids: List[str]) -> Dict[str, Any]:
"images": len(chosen), "tokens": (body.get("usage") or {}).get("total_tokens")} "images": len(chosen), "tokens": (body.get("usage") or {}).get("total_tokens")}
TONES: Dict[str, Dict[str, str]] = {
"warm": {
"label": "우아한",
"guide": ("품위 있고 단정한 문어체로 쓴다. 문장은 '~습니다'체로 통일하고 '~어요'체와 섞지 않는다. "
"다만 서류 같은 딱딱한 문장이 아니라 결이 고운 문장으로, 다정함을 어휘와 리듬에 담는다. "
"어휘를 한 단계 높인다 — '수놓다, 앉히다, 결, 올, 여백, 온기, 겹' 같은 말을 쓰고 "
"'자리해요/잡아 줘요/만들어요/~해 줍니다' 같은 구어적 표현은 쓰지 않는다. "
"'구성하다·제작하다' 같은 행정적 동사 대신 '올리다·맞추다·앉히다·수놓다'를 고른다. "
"감정은 형용사로 말하지 않고 사물의 상태로 남긴다(예: '손끝의 온기가 실에 남아 있습니다'). "
"수식은 절제하고, 문단마다 여운은 한 번만 둔다. "
"마지막 문단에 여운을 한 문장 두되, '손끝의 온기' 같은 상투적 표현을 기계적으로 붙이지 말고 "
"작품마다 다른 감각(빛, 결, 두께, 소리, 손의 리듬)을 골라 한 번만 쓴다. "
"어색한 조어나 어려운 한자어를 만들지 말고 널리 쓰는 말을 고른다. "
"과장·감탄·이모지·느낌표, '최고급/프리미엄/특별한' 같은 판매 상투어는 쓰지 않는다."),
},
"plain": {
"label": "담백한",
"guide": ("짧은 문장으로 사실만 담백하게. '~습니다'체. 재료와 시간을 숫자로 말하고 감정은 앞세우지 않는다."),
},
"lyrical": {
"label": "서정적인",
"guide": ("짧은 문장과 여백으로 쓴다. 모든 문장을 '~다'체로 끝내고 말투를 섞지 않는다. "
"계절·빛·손의 움직임 같은 감각을 남기되 사실을 벗어나지 않는다. 시를 읽는 리듬."),
},
}
DEFAULT_TONE = "warm"
WRITE_SYSTEM = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의 카피라이터다. WRITE_SYSTEM = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의 카피라이터다.
브랜드: 아이보리 린넨·무명 위에 면사로 그림을 놓는 작은 작업실. 타깃은 40~50대 여성. 브랜드: 아이보리 린넨·무명 위에 면사로 그림을 놓는 작은 작업실. 타깃은 40~50대 여성.
톤: 담백하고 구체적. 재료와 시간을 숫자로 말한다("린넨 100%", "30 × 45 cm", "열흘 남짓"). 재료와 시간은 숫자로 말한다("린넨 100%", "30 × 45 cm", "열흘 남짓"). 어투는 아래 지침을 따른다.
규칙: 규칙:
1. 주어진 사실(사진에서 읽은 것, 입력된 값) 밖의 내용을 만들지 않는다. 1. 주어진 사실(사진에서 읽은 것, 입력된 값) 밖의 내용을 만들지 않는다.
@@ -187,6 +231,7 @@ WRITE_SYSTEM = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의
4. 사진에서 읽은 것과 사용자가 적은 메모를 우선한다. 확인되지 않은 규격·가격은 쓰지 않는다. 4. 사진에서 읽은 것과 사용자가 적은 메모를 우선한다. 확인되지 않은 규격·가격은 쓰지 않는다.
사진 해석과 메모가 어긋나면 **메모를 따른다**. 사진 해석과 메모가 어긋나면 **메모를 따른다**.
5. 사진을 어떻게 읽었는지 설명하는 문장을 본문에 쓰지 않는다. 5. 사진을 어떻게 읽었는지 설명하는 문장을 본문에 쓰지 않는다.
5-1. 아래 어투 지침의 종결 어미를 글 전체에서 하나로 유지한다(섞으면 어색해진다).
("사진에서는 …로 보입니다", "메모에는 …로 적혀 있습니다" 같은 문장 금지) ("사진에서는 …로 보입니다", "메모에는 …로 적혀 있습니다" 같은 문장 금지)
6. 같은 내용을 두 문단에 반복하지 않는다. 6. 같은 내용을 두 문단에 반복하지 않는다.
7. 한국어로만 쓴다. 7. 한국어로만 쓴다.
@@ -197,6 +242,11 @@ WRITE_SYSTEM = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의
""" """
def tone_system(tone: str) -> str:
guide = TONES.get(tone) or TONES[DEFAULT_TONE]
return WRITE_SYSTEM + f"\n\n[이번 어투: {guide['label']}]\n{guide['guide']}"
def _ai_json(system: str, user: str, max_tokens: int = 2600) -> Dict[str, Any]: def _ai_json(system: str, user: str, max_tokens: int = 2600) -> Dict[str, Any]:
cfg = _ai_cfg() cfg = _ai_cfg()
payload = {"model": cfg["model"], payload = {"model": cfg["model"],
@@ -247,13 +297,15 @@ def caption(payload: Dict[str, Any]) -> Dict[str, Any]:
warning = str(error) warning = str(error)
facts = "(사진 판독 실패 — 메모와 입력값만 사용)" facts = "(사진 판독 실패 — 메모와 입력값만 사용)"
tone = str(payload.get("tone") or DEFAULT_TONE)
user = json.dumps({ user = json.dumps({
"어투": (TONES.get(tone) or TONES[DEFAULT_TONE])["label"],
"사진에서_읽은_것": facts, "사진에서_읽은_것": facts,
"사용자_메모": note or "(없음)", "사용자_메모": note or "(없음)",
"이미_정해진_값": known, "이미_정해진_값": known,
"요청": "이 작품의 제목·부제·이미지 설명·본문을 쓴다. 값이 정해진 항목은 그대로 따른다.", "요청": "이 작품의 제목·부제·이미지 설명·본문을 쓴다. 값이 정해진 항목은 그대로 따른다.",
}, ensure_ascii=False, indent=2) }, ensure_ascii=False, indent=2)
result = _ai_json(WRITE_SYSTEM, user) result = _ai_json(tone_system(tone), user)
data = result["data"] or {} data = result["data"] or {}
slug = re.sub(r"[^a-z0-9-]+", "-", str(data.get("slug") or "").lower()).strip("-") slug = re.sub(r"[^a-z0-9-]+", "-", str(data.get("slug") or "").lower()).strip("-")
draft = { draft = {
@@ -314,6 +366,12 @@ def _orient(path: Path) -> None:
def _to_jpeg(source: Path, target: Path, limit: int = 1400) -> None: def _to_jpeg(source: Path, target: Path, limit: int = 1400) -> None:
if HAS_PIL:
with Image.open(source) as image:
image = ImageOps.exif_transpose(image).convert("RGB")
image.thumbnail((limit, limit), Image.LANCZOS)
image.save(target, format="JPEG", quality=82, optimize=True, progressive=True)
return
ok = subprocess.run(["sips", "-Z", str(limit), "-s", "format", "jpeg", ok = subprocess.run(["sips", "-Z", str(limit), "-s", "format", "jpeg",
"-s", "formatOptions", "80", str(source), "--out", str(target)], "-s", "formatOptions", "80", str(source), "--out", str(target)],
capture_output=True, timeout=120).returncode == 0 capture_output=True, timeout=120).returncode == 0
@@ -324,14 +382,15 @@ def _to_jpeg(source: Path, target: Path, limit: int = 1400) -> None:
def _other_drafts(slug: str) -> List[str]: def _other_drafts(slug: str) -> List[str]:
"""커밋되지 않은 다른 작품 초안. 배포하면 함께 올라가므로 미리 알린다.""" """커밋되지 않은 다른 작품 초안. 배포하면 함께 올라가므로 미리 알린다."""
return [name for name in pending_drafts() if not name.endswith(f"/{slug}")]
def pending_drafts() -> List[str]:
"""커밋되지 않은 작품 초안 전체(경로 기준)."""
proc = subprocess.run(["git", "status", "--porcelain", "--", "content/products"], proc = subprocess.run(["git", "status", "--porcelain", "--", "content/products"],
cwd=str(ROOT), capture_output=True, text=True, timeout=30) cwd=str(ROOT), capture_output=True, text=True, timeout=30)
names: List[str] = [] return [Path(line[3:].strip()).stem for line in (proc.stdout or "").splitlines()
for line in (proc.stdout or "").splitlines(): if line[3:].strip().endswith(".md")]
path = line[3:].strip()
if path.endswith(".md") and not path.endswith(f"/{slug}.md"):
names.append(Path(path).stem)
return names
def publish(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]: def publish(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]:
@@ -371,6 +430,13 @@ def publish(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]:
_to_jpeg(source, image_dir / name) _to_jpeg(source, image_dir / name)
gallery.append(f"assets/img/{slug}/{name}") gallery.append(f"assets/img/{slug}/{name}")
# 원본(찍은 그대로)은 저장소 밖 보관함에 남긴다 — 나중에 다시 자르거나 크게 볼 때 쓴다.
if ARCHIVE:
keep = ARCHIVE / slug
keep.mkdir(parents=True, exist_ok=True)
for index, source in enumerate(sources):
shutil.copyfile(source, keep / ("cover.jpg" if index == 0 else f"photo-{index:02d}.jpg"))
data: Dict[str, Any] = { data: Dict[str, Any] = {
"slug": slug, "slug": slug,
"title": title, "title": title,
@@ -421,6 +487,10 @@ def publish(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]:
drafts = _other_drafts(slug) drafts = _other_drafts(slug)
push_ok, push_log = True, ""
if os.environ.get("TEAMAT_PUSH", "").strip().lower() in ("1", "true", "yes") and helpers.get("push"):
push_ok, push_log = helpers["push"]()
deploy_ok, deploy_log = (True, "배포하지 않음") deploy_ok, deploy_log = (True, "배포하지 않음")
if payload.get("deploy"): if payload.get("deploy"):
if drafts and not payload.get("force_deploy"): if drafts and not payload.get("force_deploy"):
@@ -432,6 +502,6 @@ def publish(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]:
return {"ok": True, "slug": slug, "title": title, "commit": commit_log, return {"ok": True, "slug": slug, "title": title, "commit": commit_log,
"deployed": bool(payload.get("deploy")) and deploy_ok, "deployed": bool(payload.get("deploy")) and deploy_ok,
"other_drafts": drafts, "other_drafts": drafts, "pushed": push_ok, "push_log": push_log[-200:],
"build_log": log, "deploy_log": deploy_log[-400:], "build_log": log, "deploy_log": deploy_log[-400:],
"url": f"/p/{slug}.html"} "url": f"/p/{slug}.html"}
+224 -6
View File
@@ -15,6 +15,7 @@ import json
import mimetypes import mimetypes
import os import os
import re import re
import shutil
import subprocess import subprocess
import sys import sys
import urllib.error import urllib.error
@@ -32,9 +33,14 @@ ASSETS = ROOT / "assets"
APP = BASE / "app.html" APP = BASE / "app.html"
MOBILE = BASE / "m.html" MOBILE = BASE / "m.html"
MANIFEST = BASE / "manifest.json" MANIFEST = BASE / "manifest.json"
TOKEN_FILE = Path.home() / ".config" / "teamat-studio" / "token" DIST = ROOT / "dist"
SITE_URL = os.environ.get("TEAMAT_SITE_URL", "https://teamat.lala.dedyn.io").rstrip("/")
# 폰 우선 배포(QNAP)에서는 첫 화면이 등록 화면이다. 데스크톱 편집 화면은 /desk.
DEFAULT_MOBILE = os.environ.get("TEAMAT_DEFAULT_PAGE", "").strip().lower() in ("m", "mobile")
TOKEN_FILE = Path(os.environ.get("TEAMAT_CONFIG_DIR") or (Path.home() / ".config" / "teamat-studio")) / "token"
import register as reg # 휴대폰 등록 흐름(사진 인박스·판독·발행) import register as reg # 휴대폰 등록 흐름(사진 인박스·판독·발행)
import update as upd # 등록된 작품 고치기
LIST_KEYS = {"gallery"} LIST_KEYS = {"gallery"}
@@ -222,9 +228,42 @@ def build() -> Tuple[bool, str]:
def deploy() -> Tuple[bool, str]: def deploy() -> Tuple[bool, str]:
"""웹 루트가 지정돼 있으면(QNAP 컨테이너) dist 를 그 자리로 복사하고, 아니면 deploy.sh(rsync)."""
web_root = os.environ.get("TEAMAT_WEB_ROOT", "").strip()
if web_root:
target = Path(web_root)
try:
target.mkdir(parents=True, exist_ok=True)
wanted = set()
for path in DIST.rglob("*"):
rel = str(path.relative_to(DIST))
wanted.add(rel)
dest = target / rel
if path.is_dir():
dest.mkdir(parents=True, exist_ok=True)
else:
dest.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(path, dest)
removed = 0
for path in sorted(target.rglob("*"), key=lambda p: len(p.parts), reverse=True):
rel = str(path.relative_to(target))
if rel in wanted:
continue
if path.is_file():
path.unlink()
removed += 1
elif path.is_dir() and not any(path.iterdir()):
path.rmdir()
return True, f"복사 완료: {target} (파일 {len(wanted)}개, 정리 {removed}개)"
except OSError as error:
return False, f"웹 루트 복사 실패: {error}"
return run(["bash", "scripts/deploy.sh"], timeout=300) return run(["bash", "scripts/deploy.sh"], timeout=300)
def push() -> Tuple[bool, str]:
return run(["git", "push", "origin", "HEAD:main"], timeout=180)
# -------------------------------------------------------------------- products io # -------------------------------------------------------------------- products io
@@ -395,12 +434,103 @@ def revert(sha: str, redeploy: bool) -> Dict[str, Any]:
return {"ok": False, "error": "되돌린 뒤 빌드 실패", "log": build_log} return {"ok": False, "error": "되돌린 뒤 빌드 실패", "log": build_log}
result: Dict[str, Any] = {"ok": True, "message": f"{sha} 되돌림", "head": head_sha(), "log": build_log} result: Dict[str, Any] = {"ok": True, "message": f"{sha} 되돌림", "head": head_sha(), "log": build_log}
if redeploy: if redeploy:
drafts = reg.pending_drafts()
if drafts:
# 초안까지 함께 올라가는 사고를 막는다(삭제 취소 버튼에서도 같은 규칙).
result["drafts"] = drafts
result["deployed"] = False
result["deploy_log"] = ("커밋하지 않은 초안이 있어 배포를 건너뛰었습니다: " + ", ".join(drafts)
+ " — 목록에서 [사이트에 올리기]로 마저 올려 주세요.")
result["message"] += " (사이트 반영은 건너뜀)"
return result
deployed, deploy_log = deploy() deployed, deploy_log = deploy()
result["deploy"] = {"ok": deployed, "log": deploy_log} result["deploy"] = {"ok": deployed, "log": deploy_log}
result["deployed"] = deployed
result["deploy_log"] = deploy_log[-400:]
result["message"] += " · 배포 완료" if deployed else " (배포 실패)" result["message"] += " · 배포 완료" if deployed else " (배포 실패)"
return result return result
def restore_paths(paths: List[str]) -> None:
"""git rm 으로 지운 파일을 커밋 전(HEAD) 상태 그대로 되살린다."""
git("reset", "-q", "HEAD", "--", *paths)
git("checkout", "HEAD", "--", *paths)
def delete_product(slug: str, deploy_after: bool = False, force: bool = False) -> Dict[str, Any]:
"""작품 하나를 md·이미지 폴더와 함께 지운다.
- 빌드가 깨지면(예: 키트·대표작이 사라짐) 지운 파일을 HEAD 에서 되살리고 취소한다.
- 지운 사실은 `작품 삭제: 제목` 커밋으로 남는다 → 이력에서 revert 하면 그대로 복구된다.
"""
slug = str(slug or "").strip()
path = product_path(slug) # 슬러그 검증 + 파일 존재 확인
lines, _ = split_front(path.read_text(encoding="utf-8"))
_, data = parse_front(lines)
title = str(data.get("title") or slug)
if not [p for p in PRODUCTS.glob("*.md") if p.stem != slug]:
return {"ok": False, "error": "마지막 남은 작품은 지울 수 없습니다 — 첫 페이지가 비어 버립니다."}
try:
site = json.loads((ROOT / "content" / "site.json").read_text(encoding="utf-8"))
except (OSError, json.JSONDecodeError):
site = {}
kit_slug = str((site.get("shop") or {}).get("kit_slug") or "").strip()
if kit_slug and kit_slug == slug:
return {"ok": False, "error": "이 작품은 첫 페이지의 키트로 지정돼 있습니다. content/site.json 의 "
"shop.kit_slug 를 다른 작품으로 바꾼 뒤 지워 주세요."}
paths = [str(path.relative_to(ROOT))]
image_dir = ASSETS / "img" / slug
if image_dir.is_dir():
paths.append(str(image_dir.relative_to(ROOT)))
removed, rm_log = git("rm", "-r", "-f", "--quiet", "--", *paths)
if not removed:
return {"ok": False, "stage": "git_rm", "error": "작품 파일을 지우지 못했습니다", "log": rm_log}
built, build_log = build()
if not built:
restore_paths(paths)
build()
return {"ok": False, "stage": "build", "log": build_log[-800:],
"error": "빌드가 깨져 삭제를 취소하고 원래대로 되돌렸습니다"}
committed, commit_log = git("commit", "-m", f"작품 삭제: {title}", "--", *paths)
if not committed:
restore_paths(paths)
build()
return {"ok": False, "stage": "git", "error": "커밋에 실패해 삭제를 되돌렸습니다", "log": commit_log}
prune_empty_image_dirs()
summary = next((line for line in (build_log or "").splitlines() if line.startswith("검증")),
(build_log or "").splitlines()[0] if build_log else "")
result: Dict[str, Any] = {
"ok": True, "slug": slug, "title": title, "deployed": False, "pushed": False,
"message": f"삭제 · 커밋 완료 — {title}",
"commit": commit_log, "head": head_sha(),
"build_log": summary,
}
if os.environ.get("TEAMAT_PUSH", "").strip().lower() in ("1", "true", "yes"):
pushed, push_log = push()
result["pushed"] = pushed
result["push_log"] = push_log[-200:]
if deploy_after:
drafts = [d for d in reg.pending_drafts() if d != slug]
if drafts and not force:
result["drafts"] = drafts
result["deploy_log"] = ("커밋하지 않은 다른 초안이 있어 배포를 건너뛰었습니다: " + ", ".join(drafts)
+ " — 목록에서 [사이트에 올리기]로 마저 올려 주세요.")
else:
deployed, deploy_log = deploy()
result["deployed"] = deployed
result["deploy_log"] = deploy_log[-400:]
result["message"] += " · 사이트에 반영" if deployed else " (사이트 반영 실패)"
return result
def upload_image(name: str, data: bytes, slug: str = "") -> Dict[str, Any]: def upload_image(name: str, data: bytes, slug: str = "") -> Dict[str, Any]:
"""이미지는 assets/img/<작품슬러그>/ 에 넣는다. 작품마다 폴더 하나.""" """이미지는 assets/img/<작품슬러그>/ 에 넣는다. 작품마다 폴더 하나."""
if not data: if not data:
@@ -651,11 +781,14 @@ class Handler(BaseHTTPRequestHandler):
return return
if path in ("/", "/index.html"): if path in ("/", "/index.html"):
self.send_page(APP) self.send_page(MOBILE if DEFAULT_MOBILE else APP)
return return
if path in ("/m", "/m.html"): if path in ("/m", "/m.html"):
self.send_page(MOBILE) self.send_page(MOBILE)
return return
if path in ("/desk", "/app", "/app.html"):
self.send_page(APP)
return
if path == "/manifest.json": if path == "/manifest.json":
self.send_page(MANIFEST, "application/manifest+json; charset=utf-8") self.send_page(MANIFEST, "application/manifest+json; charset=utf-8")
return return
@@ -668,16 +801,52 @@ class Handler(BaseHTTPRequestHandler):
return return
self.send_body(200, target.read_bytes(), "image/jpeg") self.send_body(200, target.read_bytes(), "image/jpeg")
return return
if path.startswith("/assets/"):
# 등록 화면의 아이콘·미리보기용. assets 밖으로 나가는 경로는 막는다.
target = (ROOT / path.lstrip("/")).resolve()
try:
target.relative_to(ASSETS.resolve())
except ValueError:
self.send_json({"ok": False, "error": "허용되지 않은 경로"}, 403)
return
if not target.is_file():
self.send_json({"ok": False, "error": "파일 없음"}, 404)
return
ctype = mimetypes.guess_type(target.name)[0] or "application/octet-stream"
self.send_body(200, target.read_bytes(), ctype)
return
if path.startswith("/p/") or path in ("/preview", "/preview/"):
# 빌드 결과(dist)를 그대로 보여준다 — 저장만 한 작품도 여기서 확인할 수 있다.
rel = "index.html" if path.startswith("/preview") else path.lstrip("/")
target = (DIST / rel).resolve()
try:
target.relative_to(DIST.resolve())
except ValueError:
self.send_json({"ok": False, "error": "허용되지 않은 경로"}, 403)
return
if not target.is_file():
self.send_json({"ok": False, "error": "아직 만들어진 페이지가 없습니다"}, 404)
return
ctype = mimetypes.guess_type(target.name)[0] or "application/octet-stream"
self.send_body(200, target.read_bytes(), ctype)
return
if path == "/api/presets": if path == "/api/presets":
self.send_json({"ok": True, "presets": reg.PRESETS, "vision": reg.vision_status()}) self.send_json({"ok": True, "presets": reg.PRESETS, "vision": reg.vision_status(),
"tones": [{"key": k, "label": v["label"]} for k, v in reg.TONES.items()],
"default_tone": reg.DEFAULT_TONE})
return return
if path == "/api/state": if path == "/api/state":
rows = summaries() rows = summaries()
web_root = os.environ.get("TEAMAT_WEB_ROOT", "").strip()
if web_root:
for row in rows:
row["live"] = (Path(web_root) / "p" / f"{row['slug']}.html").is_file()
self.send_json( self.send_json(
{ {
"ok": True, "ok": True,
"products": rows, "products": rows,
"count": len(rows), "count": len(rows),
"site_url": SITE_URL,
"head": head_sha(), "head": head_sha(),
"history": history(8), "history": history(8),
"fields": FIELDS, "fields": FIELDS,
@@ -742,15 +911,64 @@ class Handler(BaseHTTPRequestHandler):
except RuntimeError as error: except RuntimeError as error:
self.send_json({"ok": False, "error": str(error)}, 502) self.send_json({"ok": False, "error": str(error)}, 502)
return return
if path == "/api/publish": if path == "/api/tone":
helpers = {"build": build, "git_commit": git_commit, "deploy": deploy} payload = self.read_json()
try: try:
self.send_json(reg.publish(self.read_json(), helpers)) self.send_json(upd.rewrite_body(str(payload.get("slug") or ""), str(payload.get("tone") or "")))
except FileNotFoundError as error:
self.send_json({"ok": False, "error": str(error)}, 404)
except (ValueError, RuntimeError) as error:
self.send_json({"ok": False, "error": str(error)}, 502)
return
if path == "/api/update":
helpers = {"build": build, "git_commit": git_commit, "deploy": deploy, "push": push}
try:
result = upd.update_product(self.read_json(), helpers)
result["live_url"] = SITE_URL + str(result.get("url") or "")
self.send_json(result)
except FileNotFoundError as error:
self.send_json({"ok": False, "error": str(error)}, 404)
except ValueError as error:
self.send_json({"ok": False, "error": str(error)}, 400)
except RuntimeError as error:
self.send_json({"ok": False, "error": str(error)}, 500)
return
if path == "/api/deploy":
payload = self.read_json()
drafts = reg.pending_drafts()
if drafts and not payload.get("force"):
self.send_json({"ok": False, "needs_force": True, "drafts": drafts,
"error": "커밋하지 않은 초안이 있어 배포를 멈췄습니다: " + ", ".join(drafts)}, 409)
return
built, build_log = build()
if not built:
self.send_json({"ok": False, "log": build_log[-500:]}, 500)
return
ok, log = deploy()
self.send_json({"ok": ok, "log": (build_log.splitlines()[0] + " · " + log)[-500:], "head": head_sha()})
return
if path == "/api/publish":
helpers = {"build": build, "git_commit": git_commit, "deploy": deploy, "push": push}
try:
result = reg.publish(self.read_json(), helpers)
result["live_url"] = SITE_URL + str(result.get("url") or "")
self.send_json(result)
except ValueError as error: except ValueError as error:
self.send_json({"ok": False, "error": str(error)}, 400) self.send_json({"ok": False, "error": str(error)}, 400)
except (RuntimeError, FileNotFoundError) as error: except (RuntimeError, FileNotFoundError) as error:
self.send_json({"ok": False, "error": str(error)}, 500) self.send_json({"ok": False, "error": str(error)}, 500)
return return
if path == "/api/delete":
payload = self.read_json()
try:
self.send_json(delete_product(str(payload.get("slug") or ""),
bool(payload.get("deploy")),
bool(payload.get("force"))))
except FileNotFoundError as error:
self.send_json({"ok": False, "error": str(error)}, 404)
except ValueError as error:
self.send_json({"ok": False, "error": str(error)}, 400)
return
if path == "/api/product": if path == "/api/product":
try: try:
self.send_json(save_product(self.read_json())) self.send_json(save_product(self.read_json()))
+199
View File
@@ -0,0 +1,199 @@
"""등록된 작품 수정 — 발행(publish)과 같은 규칙으로 md·이미지·커밋을 다시 쓴다."""
from __future__ import annotations
import json
import re
import shutil
from pathlib import Path
from typing import Any, Dict, List, Tuple
import register as reg
def parse_front(raw: str) -> Tuple[Dict[str, Any], str]:
if not raw.startswith("---"):
raise ValueError("md 파일이 --- 로 시작하지 않습니다")
parts = raw.split("---", 2)
if len(parts) != 3:
raise ValueError("front matter 가 닫히지 않았습니다")
front, body = parts[1], parts[2].lstrip("\n")
data: Dict[str, Any] = {}
key = ""
for line in front.splitlines():
if not line.strip() or line.lstrip().startswith("#"):
continue
if line.startswith("- ") or line.startswith(" - "):
if key:
if not isinstance(data.get(key), list):
data[key] = []
data[key].append(line.split("- ", 1)[1].strip().strip('"'))
continue
if ":" in line:
key, value = line.split(":", 1)
key, value = key.strip(), value.strip()
if value == "":
data[key] = []
elif value in ("true", "false"):
data[key] = value == "true"
elif re.fullmatch(r"-?\d+", value):
data[key] = int(value)
else:
data[key] = value.strip('"')
return data, body
def render(data: Dict[str, Any], body: str) -> str:
order = [k for k in reg.DEFAULT_ORDER if k in data] + [k for k in data if k not in reg.DEFAULT_ORDER]
lines = ["---"]
for key in order:
value = data.get(key, "")
if key == "gallery":
lines.append("gallery:")
for item in value or []:
lines.append(f"- {reg._value(item)}")
continue
lines.append(f"{key}: {reg._value(value)}")
lines.append("---")
return "\n".join(lines) + "\n" + body.rstrip() + "\n"
def _restage_images(slug: str, items: List[Dict[str, Any]]) -> List[str]:
"""items 순서대로 cover/detail-NN 으로 다시 배치한다. 기존 사진은 복사, 새 사진(uid)은 변환."""
image_dir = reg.ASSETS / "img" / slug
image_dir.mkdir(parents=True, exist_ok=True)
staged: List[Path] = []
inbox_sources: List[Path] = []
for index, item in enumerate(items):
temp = image_dir / f".staging-{index:02d}.jpg"
if item.get("uid"):
source = reg.inbox_path(str(item["uid"]))
reg._to_jpeg(source, temp)
inbox_sources.append(source)
else:
rel = str(item.get("path") or "")
existing = (reg.ROOT / rel).resolve()
try:
existing.relative_to(image_dir.resolve())
except ValueError as error:
raise ValueError("이 작품 폴더의 사진만 쓸 수 있습니다") from error
if not existing.is_file():
raise ValueError(f"사진이 없습니다: {rel}")
shutil.copyfile(existing, temp)
staged.append(temp)
final: List[str] = []
for index, temp in enumerate(staged):
name = "cover.jpg" if index == 0 else f"detail-{index:02d}.jpg"
target = image_dir / name
temp.replace(target)
final.append(f"assets/img/{slug}/{name}")
keep = {Path(path).name for path in final}
for old in image_dir.glob("*.jpg"):
if old.name not in keep:
old.unlink(missing_ok=True)
if reg.ARCHIVE and inbox_sources:
archive_dir = reg.ARCHIVE / slug
archive_dir.mkdir(parents=True, exist_ok=True)
for index, source in enumerate(inbox_sources):
shutil.copyfile(source, archive_dir / f"added-{index:02d}.jpg")
for source in inbox_sources:
source.unlink(missing_ok=True)
return final
def update_product(payload: Dict[str, Any], helpers: Dict[str, Any]) -> Dict[str, Any]:
slug = re.sub(r"[^a-z0-9-]+", "-", str(payload.get("slug") or "").lower()).strip("-")
path = reg.PRODUCTS / f"{slug}.md"
if not path.is_file():
raise FileNotFoundError(f"작품을 찾을 수 없습니다: {slug}")
data, old_body = parse_front(path.read_text(encoding="utf-8"))
items = payload.get("images")
if isinstance(items, list) and items:
final = _restage_images(slug, items)
data["image"] = final[0]
data["gallery"] = final[1:]
for key in ("title", "subtitle", "price_note", "material", "size", "care", "image_alt", "naver_url"):
if key in payload:
data[key] = str(payload.get(key) or "").strip()
if not str(data.get("title") or "").strip():
raise ValueError("제목을 비울 수 없습니다")
if "price" in payload:
digits = re.sub(r"[^0-9]", "", str(payload.get("price") or ""))
data["price"] = int(digits) if digits and digits != "0" else ""
for key in ("sold_out", "featured"):
if key in payload:
data[key] = bool(payload.get(key))
if payload.get("date"):
date = str(payload["date"])[:10]
if re.fullmatch(r"\d{4}-\d{2}-\d{2}", date):
data["date"] = date
body = str(payload.get("body") or "").strip() or old_body
original = path.read_bytes()
path.write_text(render(data, body), encoding="utf-8")
ok, log = helpers["build"]()
if not ok:
path.write_bytes(original)
raise RuntimeError(f"빌드 실패로 수정을 되돌렸습니다: {log[-300:]}")
image_dir = reg.ASSETS / "img" / slug
commit_ok, commit_log = helpers["git_commit"](
f"작품 수정: {data.get('title')}",
[str(path.relative_to(reg.ROOT)), str(image_dir.relative_to(reg.ROOT))])
if not commit_ok:
raise RuntimeError(f"커밋 실패: {commit_log}")
push_ok, push_log = True, ""
if helpers.get("push"):
push_ok, push_log = helpers["push"]()
deploy_ok, deploy_log = (True, "배포하지 않음")
if payload.get("deploy"):
deploy_ok, deploy_log = helpers["deploy"]()
return {"ok": True, "slug": slug, "commit": commit_log,
"deployed": bool(payload.get("deploy")) and deploy_ok,
"pushed": push_ok, "build_log": log[-300:], "deploy_log": deploy_log[-300:],
"url": f"/p/{slug}.html"}
def rewrite_body(slug: str, tone: str) -> Dict[str, Any]:
"""기존 본문을 다른 어투로 다시 쓴다(저장은 사람이 확인하고 한다)."""
slug = re.sub(r"[^a-z0-9-]+", "-", str(slug or "").lower()).strip("-")
path = reg.PRODUCTS / f"{slug}.md"
if not path.is_file():
raise FileNotFoundError(f"작품을 찾을 수 없습니다: {slug}")
data, body = parse_front(path.read_text(encoding="utf-8"))
guide = reg.TONES.get(tone) or reg.TONES[reg.DEFAULT_TONE]
system = reg.tone_system(tone) + (
"\n\n지금 할 일: 아래 '지금 본문'을 같은 사실 그대로 두고 어투만 바꿔 다시 쓴다."
"\n- 재료·규격·가격·기간 같은 값은 바꾸지 않는다. 없는 사실을 더하지 않는다."
"\n- 문단 수는 2~4개를 지킨다."
'\n응답은 설명 없이 JSON 하나: {"body": "새 본문 전문"}'
)
user = json.dumps({
"제목": str(data.get("title") or ""),
"부제": str(data.get("subtitle") or ""),
"소재": str(data.get("material") or ""),
"규격": str(data.get("size") or ""),
"지금_본문": body.strip(),
"지금_어투": "지금 본문의 어미를 물려받지 말고, 문장 종결 어미를 반드시 위 어투로 바꾼다",
}, ensure_ascii=False, indent=2)
result = reg._ai_json(system, user)
new_body = str((result.get("data") or {}).get("body") or "").strip()
if not new_body:
raise RuntimeError("AI가 본문을 만들지 못했습니다 — 다시 눌러 주세요")
return {"ok": True, "slug": slug, "tone": tone, "tone_label": guide["label"],
"before": body.strip(), "body": new_body, "tokens": result.get("tokens")}
+5 -4
View File
@@ -9,6 +9,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500&amp;family=Noto+Serif+KR:wght@400;600&amp;display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500&amp;family=Noto+Serif+KR:wght@400;600&amp;display=swap" rel="stylesheet">
<link rel="canonical" href="{{canonical}}">
<link rel="stylesheet" href="{{asset_prefix}}assets/css/site.css"> <link rel="stylesheet" href="{{asset_prefix}}assets/css/site.css">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23F6F2EA'/%3E%3Cpath d='M9 9l14 14M23 9L9 23' stroke='%236C7A63' stroke-width='2'/%3E%3C/svg%3E"> <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23F6F2EA'/%3E%3Cpath d='M9 9l14 14M23 9L9 23' stroke='%236C7A63' stroke-width='2'/%3E%3C/svg%3E">
<meta property="og:title" content="{{og_title}}"> <meta property="og:title" content="{{og_title}}">
@@ -26,10 +27,10 @@
<span class="wordmark-en">{{brand_name_en}}</span> <span class="wordmark-en">{{brand_name_en}}</span>
</a> </a>
<nav class="nav" aria-label="주요"> <nav class="nav" aria-label="주요">
<a href="{{home}}index.html#works">작품</a> <a href="{{home}}#works">작품</a>
<a href="{{home}}index.html#process">과정</a> <a href="{{home}}#process">과정</a>
<a href="{{home}}index.html#kit">키트</a> <a href="{{home}}#kit">키트</a>
<a href="{{home}}index.html#contact">문의</a> <a href="{{home}}#contact">문의</a>
</nav> </nav>
</div> </div>
</header> </header>
+70 -1
View File
@@ -41,7 +41,6 @@
<h3>{{title}}</h3> <h3>{{title}}</h3>
<p class="work-sub">{{subtitle}}</p> <p class="work-sub">{{subtitle}}</p>
<p class="work-price">{{price_text}}</p> <p class="work-price">{{price_text}}</p>
{{sold_html}}
</div> </div>
</a> </a>
</article> </article>
@@ -50,6 +49,76 @@
</div> </div>
</section> </section>
<section class="section soldout" id="soldout" aria-labelledby="soldout-title">
<div class="shell">
<header class="section-head">
<p class="label">SOLD OUT</p>
<h2 id="soldout-title">지난 작품 — 제작 문의</h2>
<p class="section-note">{{sold_note}}</p>
</header>
{{sold_empty_html}}
<div class="works-grid">
{{#sold_products}}
<article class="work is-sold">
<a class="work-link" href="{{href}}">
<figure class="work-figure">
<img src="{{image}}" alt="{{alt}}" width="{{width}}" height="{{height}}" loading="lazy" decoding="async">
</figure>
<div class="work-caption">
<h3>{{title}}</h3>
<p class="work-sub">{{subtitle}}</p>
<p class="work-price">{{price_text}}</p>
<p class="work-sold">판매 완료</p>
</div>
</a>
<button class="inquiry-btn" type="button" data-inquiry="{{inquiry_title}}">카톡으로 제작 문의</button>
<p class="inquiry-note">재고가 없어 주문을 받은 뒤 제작합니다. 아래 문구가 복사되니 카톡 대화창에 붙여넣어 주세요.</p>
</article>
{{/sold_products}}
</div>
</div>
</section>
<script>
(function () {
var KAKAO = "{{kakao_url}}";
var TEMPLATE = function (title) {
return [
title + " 재제작 문의드립니다.",
"",
"- 원하는 시기: ",
"- 크기·색상: ",
"- 문의 내용: "
].join("\n");
};
document.querySelectorAll("[data-inquiry]").forEach(function (btn) {
btn.addEventListener("click", function () {
var title = btn.getAttribute("data-inquiry") || "작품";
var text = TEMPLATE(title);
var note = btn.parentElement.querySelector(".inquiry-note");
var done = function (copied) {
if (note) {
note.textContent = copied
? "문의 문구를 복사했습니다. 카톡 대화창에 붙여넣어 보내 주세요."
: "카톡에서 새 대화를 열고 아래 내용을 적어 보내 주세요: " + text;
}
};
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(function () { done(true); }, function () { done(false); });
} else {
done(false);
}
if (KAKAO) {
window.open(KAKAO, "_blank", "noopener");
} else {
window.location.href = "kakaotalk://";
}
});
});
})();
</script>
<section class="section process" id="process" aria-labelledby="process-title"> <section class="section process" id="process" aria-labelledby="process-title">
<div class="shell"> <div class="shell">
<header class="section-head"> <header class="section-head">
+25 -20
View File
@@ -2,17 +2,30 @@
<a class="back-link" href="../index.html#works">← 작품 목록</a> <a class="back-link" href="../index.html#works">← 작품 목록</a>
</div> </div>
<article class="product shell"> <article class="product">
<div class="product-top"> <header class="product-head shell">
<figure class="product-media"> <h1 class="product-title">{{title}}</h1>
<img src="../{{image}}" alt="{{alt}}" width="{{width}}" height="{{height}}" loading="eager" fetchpriority="high" decoding="async"> <p class="product-sub">{{subtitle}}</p>
</figure> <p class="product-head-price">{{price_text}}</p>
{{price_note_html}}
</header>
<div class="product-info"> <figure class="product-hero">
<h1>{{title}}</h1> <img src="../{{image}}" alt="{{alt}}" width="{{width}}" height="{{height}}" loading="eager" fetchpriority="high" decoding="async">
<p class="product-sub">{{subtitle}}</p> </figure>
<p class="product-price">{{price_text}}</p>
{{price_note_html}} {{gallery_html}}
<section class="product-story shell">
<p class="label">STORY</p>
<div class="prose">
{{body_html}}
</div>
</section>
<section class="product-detail shell">
<p class="label">DETAILS</p>
<div class="detail-body">
{{sold_html}} {{sold_html}}
{{buy_html}} {{buy_html}}
<a class="studio-edit" href="http://localhost:8081/?slug={{slug}}" hidden>이 작품 고치기</a> <a class="studio-edit" href="http://localhost:8081/?slug={{slug}}" hidden>이 작품 고치기</a>
@@ -32,17 +45,9 @@
</div> </div>
</dl> </dl>
</div> </div>
</div> </section>
<div class="product-story"> <nav class="pager shell" aria-label="다른 작품">
<p class="label">STORY</p>
<div class="prose">
{{body_html}}
</div>
{{gallery_html}}
</div>
<nav class="pager" aria-label="다른 작품">
<div class="pager-slot pager-prev">{{prev_html}}</div> <div class="pager-slot pager-prev">{{prev_html}}</div>
<div class="pager-slot pager-next">{{next_html}}</div> <div class="pager-slot pager-next">{{next_html}}</div>
</nav> </nav>