Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ecc8ab4474 | ||
|
|
beaaf6555c | ||
|
|
72e1926d87 | ||
|
|
7aaa488825 | ||
|
|
ddae2c776a | ||
|
|
e1ddbff1f5 | ||
|
|
3d5a015400 | ||
|
|
bdbad3ec6d | ||
|
|
d84b4e4d61 | ||
|
|
b81eb5745f | ||
|
|
7619eef367 | ||
|
|
9434a08480 | ||
|
|
b803ab4efd | ||
|
|
aba5d4d6e2 | ||
|
|
ebbec84ba6 | ||
|
|
c10a1c76fb | ||
|
|
09ad856c0b | ||
|
|
bc01e7cfe6 | ||
|
|
9c234b0c43 | ||
|
|
07900de9aa | ||
|
|
dd203f2113 | ||
|
|
71a01228c6 | ||
|
|
c766e70922 | ||
|
|
aa79358d64 | ||
|
|
53477b387d | ||
|
|
97a6961d88 | ||
|
|
02e654d75e | ||
|
|
a749b9daf8 | ||
|
|
a6835e943a | ||
|
|
f2ae889795 | ||
|
|
51f3cdbe1c |
No files matched your search
@@ -113,6 +113,7 @@ naver_url: "" # 스마트스토어 상품 주소. 비우면
|
||||
```
|
||||
|
||||
- **새 작품 추가 = 이 파일 1개 추가 → `python3 build.py`.** 목록과 상세가 자동 생성된다.
|
||||
- `sold_out: true` 인 작품은 첫 페이지의 **판매 완료 섹션**으로 내려가고, 카드·상세에 `카톡으로 제작 문의` 버튼이 붙는다. 판매 재개는 `false` 로 되돌리는 것.
|
||||
- 파일명 = `slug` = **`연-월-영문제목`** (예: `2026-11-magnolia-tea-mat.md`). 앞의 연-월로 시기를 바로 구분하고 `ls`·`git log` 가 시간순으로 정렬된다. 한국어 제목은 `title` 에 쓴다(URL 은 영문 유지).
|
||||
- **작품 이미지는 `assets/img/<slug>/` 폴더에 넣는다** — 대표는 `cover.jpg`, 추가 컷은 `detail-01.jpg` 처럼. 작품마다 폴더 하나, 다른 작품과 섞지 않는다.
|
||||
- 공정·브랜드 공용 이미지는 `assets/img/process/` 에 둔다.
|
||||
@@ -157,6 +158,8 @@ image_alt: 조각보
|
||||
- 제목: `Noto Serif KR` (serif), 본문: `Noto Sans KR` (sans). CDN 실패 시 시스템 폰트 폴백.
|
||||
- 여백 위주, 그림자·그라데이션·둥근 카드 금지. 구분은 1px 실선.
|
||||
- 사진이 주인공: 최소 60vw 폭 또는 4:5 세로 컷. 호버 확대는 1.02 이하.
|
||||
- **상세 페이지 순서는 고정**: ① 작은 제목(+부제·가격, `product-head`) ② 메인 사진(`product-hero`, 폭 min(100%,1080px), 자르지 않고 원본 비율)
|
||||
③ 서브 사진(`gallery`, 한 열로 세로로 이어 붙임) ④ 스토리(`product-story`) ⑤ DETAILS(구매 버튼 + 소재·규격·세탁 `spec`) — 사양은 항상 맨 아래.
|
||||
|
||||
## 7. 자주 쓰는 명령
|
||||
|
||||
|
||||
@@ -84,6 +84,22 @@ bash scripts/studio.sh # http://localhost:8081
|
||||
- 흐름: ① 사진 찍기(여러 장, 첫 장이 대표) → ② 내용 작성(사진을 읽어 초안) → ③ 규격·소재·세탁 칩 + 가격 → ④ 확인 후 저장
|
||||
- 저장하면 완료 화면에 `목록으로 돌아가기` 가 나오고, 목록의 그 작품에 `방금 등록` 배지가 붙는다. `저장만` 으로 저장한 작품은 `미발행` 배지가 붙는다.
|
||||
- 목록 위 `사이트에 올리기 (미발행 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)
|
||||
@@ -98,6 +114,19 @@ bash scripts/studio.sh # http://localhost:8081
|
||||
|
||||
비상용: 아이맥에서만 돌리는 예전 방식도 남아 있다. `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 */` 절.
|
||||
|
||||
## 대화로 고치기
|
||||
|
||||
Claude Code 에 말로 지시하면 위 파일들을 알아서 고친다. 예:
|
||||
|
||||
@@ -772,7 +772,7 @@ strong {
|
||||
|
||||
.back-link {
|
||||
display: inline-block;
|
||||
margin-block: 8px 28px;
|
||||
margin-block: 8px 20px;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
text-decoration: none;
|
||||
@@ -786,47 +786,136 @@ strong {
|
||||
padding-bottom: clamp(40px, 6vw, 80px);
|
||||
}
|
||||
|
||||
.product-top {
|
||||
/* 제목은 작게 — 사진이 먼저 보이도록 */
|
||||
.product-head {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
|
||||
gap: clamp(36px, 5vw, 80px);
|
||||
align-items: start;
|
||||
gap: 4px;
|
||||
margin-bottom: clamp(14px, 2.5vw, 26px);
|
||||
}
|
||||
|
||||
.product-media {
|
||||
aspect-ratio: 4 / 5;
|
||||
overflow: hidden;
|
||||
background: var(--line);
|
||||
}
|
||||
|
||||
.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-title {
|
||||
margin: 0;
|
||||
font-size: clamp(1.05rem, 1.4vw, 1.3rem);
|
||||
font-weight: 400;
|
||||
line-height: 1.45;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.product-sub {
|
||||
margin-top: 14px;
|
||||
margin: 0;
|
||||
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;
|
||||
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 {
|
||||
margin-top: 26px;
|
||||
font-size: 18px;
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
@@ -837,19 +926,19 @@ strong {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.product-info .btn,
|
||||
.product-info .pending {
|
||||
margin-top: 24px;
|
||||
.detail-body .btn,
|
||||
.detail-body .pending {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.product-sold {
|
||||
margin-top: 8px;
|
||||
margin-top: 10px;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.spec {
|
||||
margin-top: 44px;
|
||||
margin-top: 30px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
|
||||
@@ -873,73 +962,52 @@ strong {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.product-story {
|
||||
display: grid;
|
||||
grid-template-columns: 120px minmax(0, 1fr);
|
||||
gap: clamp(20px, 4vw, 56px);
|
||||
align-items: start;
|
||||
margin-top: clamp(72px, 10vw, 140px);
|
||||
/* ------------------------------------------------------------ sold out */
|
||||
|
||||
.soldout .section-head {
|
||||
border-top: 1px solid var(--line);
|
||||
padding-top: clamp(36px, 5vw, 64px);
|
||||
}
|
||||
|
||||
.product-story .label {
|
||||
padding-top: 10px;
|
||||
.soldout {
|
||||
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 {
|
||||
margin-bottom: 1.4em;
|
||||
font-size: 17px;
|
||||
line-height: 1.85;
|
||||
.inquiry-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
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 {
|
||||
font-size: clamp(1.25rem, 1.9vw, 1.5rem);
|
||||
line-height: 1.7;
|
||||
.inquiry-btn:hover {
|
||||
background: var(--sage);
|
||||
border-color: var(--sage);
|
||||
}
|
||||
|
||||
.prose p:last-child {
|
||||
margin-bottom: 0;
|
||||
.inquiry-note {
|
||||
margin-top: 8px;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.prose h2 {
|
||||
margin: 2em 0 0.7em;
|
||||
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;
|
||||
.detail-body .inquiry-btn {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.pager {
|
||||
@@ -1084,29 +1152,20 @@ strong {
|
||||
gap: 48px;
|
||||
}
|
||||
|
||||
.product-top {
|
||||
.product-story,
|
||||
.product-detail {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.product-info {
|
||||
position: static;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.product-info .spec {
|
||||
margin-top: 36px;
|
||||
}
|
||||
|
||||
.product-story {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.product-story .label {
|
||||
.product-story .label,
|
||||
.product-detail > .label {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.product-hero,
|
||||
.gallery {
|
||||
grid-column: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.foot-meta {
|
||||
@@ -1129,10 +1188,17 @@ strong {
|
||||
}
|
||||
|
||||
.nav {
|
||||
gap: 18px;
|
||||
gap: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 터치 영역 44px 확보 — 음수 마진으로 글자 위치는 그대로 둔다 */
|
||||
.nav a {
|
||||
display: inline-block;
|
||||
padding: 12px 11px;
|
||||
margin-block: -12px;
|
||||
}
|
||||
|
||||
.wordmark-en {
|
||||
display: none;
|
||||
}
|
||||
@@ -1224,7 +1290,7 @@ strong {
|
||||
}
|
||||
|
||||
.nav {
|
||||
gap: 14px;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.wordmark-ko {
|
||||
|
||||
|
Before Width: | Height: | Size: 601 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 309 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 301 KiB |
|
After Width: | Height: | Size: 287 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 332 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 350 KiB |
|
After Width: | Height: | Size: 292 KiB |
@@ -370,6 +370,7 @@ def build_shared(site: Dict[str, Any], home: str, asset_prefix: str) -> Dict[str
|
||||
"credits": credits,
|
||||
"home": home,
|
||||
"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", "")),
|
||||
"price_text": format_price(product.get("price")),
|
||||
"sold_html": sold_html,
|
||||
"inquiry_title": esc(product["title"]),
|
||||
}
|
||||
)
|
||||
return items
|
||||
@@ -468,6 +470,7 @@ def build_index(
|
||||
"og_title": esc(title),
|
||||
"og_description": esc(intro),
|
||||
"og_image": esc(absolute_url(hero_image)),
|
||||
"canonical": SITE_BASE,
|
||||
"og_type": "website",
|
||||
"body_class": "is-home",
|
||||
"intro": esc(intro),
|
||||
@@ -479,7 +482,13 @@ def build_index(
|
||||
"hero_material": esc(featured.get("material", "")),
|
||||
"hero_href": f"p/{featured['slug']}.html",
|
||||
"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_intro": esc(site.get("process_intro", "")),
|
||||
"kit_title": esc(kit["title"]),
|
||||
@@ -526,7 +535,11 @@ def build_product_page(
|
||||
width, height = image_size(image)
|
||||
|
||||
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:
|
||||
naver_url = str(product.get("naver_url", "")).strip()
|
||||
if naver_url:
|
||||
@@ -577,6 +590,7 @@ def build_product_page(
|
||||
"og_title": esc(title),
|
||||
"og_description": esc(description),
|
||||
"og_image": esc(absolute_url(image)),
|
||||
"canonical": absolute_url("p/" + product["slug"] + ".html"),
|
||||
"og_type": "product",
|
||||
"body_class": "is-product",
|
||||
"slug": esc(product["slug"]),
|
||||
@@ -591,6 +605,7 @@ def build_product_page(
|
||||
"price_note_html": price_note_html,
|
||||
"sold_html": '<p class="product-sold">판매 완료</p>' if product.get("sold_out") else "",
|
||||
"buy_html": buy_html,
|
||||
"inquiry_title": esc(product["title"]),
|
||||
"material": esc(material) or "—",
|
||||
"size": esc(product.get("size", "")) or "—",
|
||||
"care": esc(product.get("care", "")) or "—",
|
||||
|
||||
@@ -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: ""
|
||||
---
|
||||
성긴 린넨의 올 사이로 빛이 지나갑니다. 그 위에 녹색 면사로 솔잎을 길게 놓았습니다. 잎마다 방향을 조금씩 달리해, 같은 잎이 반복되지 않게 했습니다.
|
||||
|
||||
가장자리는 접어 박음질하고, 귀퉁이마다 실을 두 번 돌려 마무리했습니다. 티포트를 올리면 잎의 방향을 따라 그림자가 생깁니다.
|
||||
|
||||
한 점에 보름 남짓 걸렸습니다. 실의 색은 세 가지를 나란히 놓고 골랐습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
|
||||
@@ -14,8 +14,8 @@ size: 완성 10 × 10 cm × 4장
|
||||
care: 완성 후 미지근한 물에 단독 손세탁
|
||||
naver_url: "https://smartstore.naver.com/lalashopkr/products/5758959852"
|
||||
---
|
||||
완제품이 아닙니다. 천에 도안이 옅게 찍혀 있고, 실과 바늘이 함께 들어 있습니다. 도안을 따라 한 땀씩 놓으면 10 × 10 cm 티매트 네 장이 됩니다.
|
||||
완제품이 아닙니다. 천 위에 도안이 옅게 앉아 있고, 실과 바늘이 한 상자에 함께 들었습니다. 도안을 따라 한 땀씩 놓으면 10 × 10 cm 티매트 네 장이 됩니다.
|
||||
|
||||
처음이면 가장자리부터 시작하세요. 실을 길게 빼지 않고, 한 땀 놓고 손을 한 번 내리는 리듬이 익숙해지면 안쪽으로 들어갑니다. 도안은 단순하게 그렸습니다. 천의 결을 가리지 않도록.
|
||||
처음이시라면 가장자리부터 시작하시면 좋습니다. 실을 길게 빼지 않고, 한 땀 놓고 손을 한 번 내리는 리듬이 익숙해지면 안쪽으로 들어갑니다. 도안은 천의 결을 가리지 않도록 단순하게 그렸습니다.
|
||||
|
||||
막히면 메일로 물어보셔도 됩니다. 사진 한 장을 보내주시면 어느 자리에서 멈췄는지 함께 봅니다.
|
||||
막히면 메일로 연락하실 수 있습니다. 사진 한 장을 보내시면 어느 자리에서 멈추셨는지 함께 살펴보겠습니다. 한 장을 마치고 나면 바늘을 쥔 손이 조금 가벼워집니다.
|
||||
@@ -5,24 +5,24 @@ subtitle: 흰 실로 놓는 네 가지 무늬
|
||||
date: 2026-10-28
|
||||
price: 15000
|
||||
price_note: 네 장 세트 50,000원
|
||||
sold_out: false
|
||||
sold_out: 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: 남색 면 천 네 장에 흰 실로 십자·칠보·마노하 무늬를 놓은 사시코 티매트
|
||||
gallery:
|
||||
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_06.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_04.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_10.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/lala_S033_detail_11.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/detail-01.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/detail-02.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/detail-03.jpg
|
||||
- assets/img/2026-10-whitework-tea-mat/detail-04.jpg
|
||||
material: 면 100% (남색·자주) · 사시코 실(면)
|
||||
size: 10 × 10 cm (한 장)
|
||||
care: 미지근한 물에 중성세제로 단독 손세탁
|
||||
naver_url: ""
|
||||
---
|
||||
짙은 남색 면 천 위에 흰 실로 사시코를 놓았습니다. 십자가 이어지는 무늬, 겹친 원이 늘어서는 칠보, 별처럼 뻗는 마노하 — 네 장에 서로 다른 무늬를 하나씩 놓았습니다.
|
||||
짙은 남색 면 위에 흰 사시코 실을 앉혔습니다. 십자가 이어지는 무늬, 겹친 원이 늘어서는 칠보, 별처럼 뻗어 나가는 마노하 — 네 장에 서로 다른 무늬를 하나씩 수놓았습니다.
|
||||
|
||||
도안선을 따라 한 땀씩 나아갑니다. 실이 천을 지나며 결이 살아나고, 남색과 흰 실의 대비가 무늬의 선을 또렷하게 만듭니다. 실은 오리무파스 사시코실을 씁니다.
|
||||
도안선을 따라 한 땀씩 나아갑니다. 실이 천의 올을 지나며 결이 살아나고, 남색과 흰 실의 대비가 무늬의 선을 또렷하게 세웁니다. 실은 오리무파스 사시코실을 씁니다.
|
||||
|
||||
한 장에 15,000원이고, 네 장을 한 세트로 묶으면 50,000원입니다. 무늬와 장수는 메일로 알려주시면 그에 맞춰 놓습니다.
|
||||
한 장은 15,000원이며, 네 장을 한 세트로 묶으면 50,000원입니다. 무늬와 장수는 메일로 알려주시면 그에 맞추어 놓습니다.
|
||||
|
||||
자주빛으로 물들인 천도 함께 만들었습니다. 같은 무늬라도 색이 바뀌면 다른 표정이 됩니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
|
||||
자주빛으로 물들인 천도 함께 두었습니다. 같은 무늬라도 색이 바뀌면 다른 표정이 되며, 쓰고 난 뒤에는 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다. 장마다 실을 앉힌 자리가 조금씩 달라, 네 장을 나란히 두면 그 차이가 드러납니다.
|
||||
@@ -17,8 +17,8 @@ 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: ""
|
||||
---
|
||||
코펜하겐이라는 이름의 자수가 천 위에 앉았습니다. 이름 하나가 작품의 첫 문장이 되고, 그 아래로 실올이 한 땀씩 제자리를 찾아갑니다. 도시의 이름을 빌렸으나 완성되는 것은 손의 리듬입니다.
|
||||
|
||||
천의 결을 따라 바늘을 세우고, 실은 조이지 않고 놓아둡니다. 성급히 당기면 천이 울고, 알맞게 앉히면 표면이 고르게 정돈됩니다. 그 차이는 손이 먼저 알고 눈이 나중에 알아차립니다.
|
||||
|
||||
마지막 땀을 매듭지으면 실은 조용히 천에 눌러앉습니다. 창가의 빛이 비스듬히 들 때, 수놓인 자리의 두께가 손끝에 남는 하루입니다.
|
||||
@@ -1,18 +0,0 @@
|
||||
---
|
||||
slug: 2026-11-edit-test
|
||||
title: 수정한 작품 제목
|
||||
subtitle: 고친 부제
|
||||
date: 2026-11-01
|
||||
price: 23000
|
||||
price_note: ""
|
||||
sold_out: false
|
||||
featured: false
|
||||
image: assets/img/2026-11-edit-test/cover.jpg
|
||||
image_alt: 천 위에 흰 실로 무늬를 놓은 모습
|
||||
gallery:
|
||||
material: 린넨 100%
|
||||
size: 12 × 12 cm
|
||||
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분 담갔다 그늘 건조
|
||||
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원이 더 붙습니다.
|
||||
|
||||
도안과 촬영 사진의 저작권은 라라원단에 있습니다. 상업적인 사용은 삼가 주세요.
|
||||
도안과 촬영 사진의 저작권은 라라원단에 있습니다. 상업적인 사용은 삼가 주십시오.
|
||||
@@ -9,7 +9,7 @@
|
||||
"contact": {
|
||||
"email": "hello@hanttam.kr",
|
||||
"instagram": "",
|
||||
"kakao": ""
|
||||
"kakao": "https://pf.kakao.com/_VsLWX/friend"
|
||||
},
|
||||
"shop": {
|
||||
"kit_slug": "2026-10-kit-first-stitch",
|
||||
@@ -31,7 +31,16 @@
|
||||
"product_sort": "newest",
|
||||
"footer_note": "사업자등록번호와 통신판매업 신고 번호는 추후 기재합니다.",
|
||||
"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": "재고가 없는 작품입니다. 같은 무늬로 다시 만들 수 있어요 — 카톡으로 문의하시면 제작 일정과 값을 함께 알려 드립니다."
|
||||
}
|
||||
@@ -3,23 +3,21 @@ set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
REMOTE="admin@100.101.79.24"
|
||||
REMOTE_DIR="/share/CACHEDEV8_DATA/web/www/teamat/"
|
||||
SITE_URL="https://home.lala.dedyn.io/teamat/" # 서브패스(항상 유효) — 배포 성공 판정용
|
||||
SITE_URL2="https://teamat.lala.dedyn.io/" # 전용 도메인 — 인증서 발급 전에는 000 이 나올 수 있다
|
||||
# 2026-11-27: 공개 사이트는 이 폴더의 dist/ 를 그대로 서빙한다.
|
||||
# umbrel 컨테이너 `web`(caddy :8082) → https://teamat.lala.dedyn.io/ , https://home.lala.dedyn.io/teamat/
|
||||
# (마운트: /Home/teamat/dist → 웹루트). 그래서 build 만 하면 즉시 반영되고,
|
||||
# QNAP 으로의 rsync 배포 단계는 폐지했다.
|
||||
SITE_URL="https://home.lala.dedyn.io/teamat/"
|
||||
SITE_URL2="https://teamat.lala.dedyn.io/"
|
||||
|
||||
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")"
|
||||
if [ "$status" != "200" ]; then
|
||||
echo "배포 후 확인 실패: ${SITE_URL} (HTTP ${status})" >&2
|
||||
echo "확인 실패: ${SITE_URL} (HTTP ${status})" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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})"
|
||||
@@ -75,6 +75,9 @@
|
||||
.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)}
|
||||
.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.err{color:#9B3B2A}
|
||||
.toast{position:fixed;left:50%;bottom:calc(110px + var(--safe-b));transform:translateX(-50%);
|
||||
@@ -87,13 +90,18 @@
|
||||
.summary{font-size:14px;color:var(--muted);margin-bottom:14px}
|
||||
.summary b{color:var(--ink);font-weight:500}
|
||||
a.live{color:var(--sage)}
|
||||
.work-card{display:grid;grid-template-columns:88px 1fr;gap:12px;align-items:center;text-decoration:none;
|
||||
color:var(--ink);padding:10px 0;border-bottom:1px solid var(--line);position:relative}
|
||||
.work-card img{width:88px;aspect-ratio:4/5;object-fit:cover;background:var(--line);display:block}
|
||||
.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>
|
||||
@@ -119,6 +127,12 @@
|
||||
<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>
|
||||
</section>
|
||||
|
||||
<!-- ② 사진 -->
|
||||
@@ -146,6 +160,8 @@
|
||||
<textarea id="note" style="min-height:84px" placeholder="예: 와인색 코튼린넨, 네 장, 사시코 실 포함"></textarea>
|
||||
</label>
|
||||
<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>
|
||||
<div class="status" id="cap-status"></div>
|
||||
<div id="cap-out" hidden style="margin-top:18px">
|
||||
@@ -208,6 +224,78 @@
|
||||
<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>
|
||||
</main>
|
||||
|
||||
<div class="bar" id="bar">
|
||||
@@ -217,7 +305,8 @@
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<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 toast = (m, ms=2200) => { const t=$('#toast'); t.textContent=m; t.classList.add('on');
|
||||
@@ -240,6 +329,7 @@ const STEPS = {
|
||||
write:{el:'#s-write', n:'2/4 내용', prev:'photos', next:'specs'},
|
||||
specs:{el:'#s-specs', n:'3/4 항목', prev:'write', next:'done'},
|
||||
done:{el:'#s-done', n:'4/4 저장', prev:'specs', next:null},
|
||||
edit:{el:'#s-edit', n:'고치기', prev:null, next:null},
|
||||
};
|
||||
function go(step){
|
||||
S.step = step;
|
||||
@@ -247,7 +337,7 @@ function go(step){
|
||||
$(STEPS[step].el).hidden = false;
|
||||
$('#steps').textContent = STEPS[step].n;
|
||||
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';
|
||||
const next = $('#next');
|
||||
next.textContent = step==='specs' ? '확인' : '다음';
|
||||
@@ -277,16 +367,21 @@ async function loadHome(){
|
||||
? rows.length + '점 · 최근에 만든 순서입니다. 눌러서 확인하세요.'
|
||||
: '아직 등록한 작품이 없습니다.';
|
||||
$('#home-list').innerHTML = rows.map(p => `
|
||||
<a class="work-card" 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>
|
||||
<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>' : '')}
|
||||
</a>`).join('') || '<p class="note">아직 없습니다.</p>';
|
||||
</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');
|
||||
@@ -364,6 +459,7 @@ $('#cap').onclick = async () => {
|
||||
$('#cap-status').innerHTML = '<span class="spin"></span> 사진을 읽고 문장을 쓰는 중… (10~30초)';
|
||||
try{
|
||||
const d = await api('/api/caption', {
|
||||
tone: S.tone,
|
||||
photos: S.photos.map(p=>p.uid),
|
||||
note: $('#note').value.trim(),
|
||||
known: { size:$('#f-size').value.trim(), material:$('#f-material').value.trim(),
|
||||
@@ -402,10 +498,12 @@ const SR = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
async function loadPresets(){
|
||||
try{
|
||||
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=>{
|
||||
const key = box.dataset.for === 'f-size' ? 'size'
|
||||
: box.dataset.for === 'f-material' ? 'material' : 'care';
|
||||
const target = box.dataset.for;
|
||||
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.querySelectorAll('.chip').forEach(ch=>ch.onclick=()=>{
|
||||
box.querySelectorAll('.chip').forEach(c=>c.setAttribute('aria-pressed','false'));
|
||||
@@ -413,6 +511,9 @@ async function loadPresets(){
|
||||
$('#'+box.dataset.for).value = ch.textContent;
|
||||
});
|
||||
});
|
||||
S.tone = d.default_tone || 'warm';
|
||||
S.editTone = S.tone;
|
||||
paintTones();
|
||||
}catch(e){ toast(e.message); }
|
||||
}
|
||||
|
||||
@@ -500,8 +601,220 @@ $('#deploy-all').onclick = async () => {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 시작 ---------- */
|
||||
go('home'); loadPresets();
|
||||
// 목록의 링크나 알림에서 바로 열 수 있게: /m?slug=<슬러그> → 그 작품 고치기 화면
|
||||
const deepSlug = new URLSearchParams(location.search).get('slug');
|
||||
if (deepSlug) openEdit(deepSlug);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -190,10 +190,38 @@ def photo_facts(uids: List[str]) -> Dict[str, Any]:
|
||||
"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 = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의 카피라이터다.
|
||||
|
||||
브랜드: 아이보리 린넨·무명 위에 면사로 그림을 놓는 작은 작업실. 타깃은 40~50대 여성.
|
||||
톤: 담백하고 구체적. 재료와 시간을 숫자로 말한다("린넨 100%", "30 × 45 cm", "열흘 남짓").
|
||||
재료와 시간은 숫자로 말한다("린넨 100%", "30 × 45 cm", "열흘 남짓"). 어투는 아래 지침을 따른다.
|
||||
|
||||
규칙:
|
||||
1. 주어진 사실(사진에서 읽은 것, 입력된 값) 밖의 내용을 만들지 않는다.
|
||||
@@ -203,6 +231,7 @@ WRITE_SYSTEM = """너는 한국의 핸드메이드 자수 브랜드 "한땀"의
|
||||
4. 사진에서 읽은 것과 사용자가 적은 메모를 우선한다. 확인되지 않은 규격·가격은 쓰지 않는다.
|
||||
사진 해석과 메모가 어긋나면 **메모를 따른다**.
|
||||
5. 사진을 어떻게 읽었는지 설명하는 문장을 본문에 쓰지 않는다.
|
||||
5-1. 아래 어투 지침의 종결 어미를 글 전체에서 하나로 유지한다(섞으면 어색해진다).
|
||||
("사진에서는 …로 보입니다", "메모에는 …로 적혀 있습니다" 같은 문장 금지)
|
||||
6. 같은 내용을 두 문단에 반복하지 않는다.
|
||||
7. 한국어로만 쓴다.
|
||||
@@ -213,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]:
|
||||
cfg = _ai_cfg()
|
||||
payload = {"model": cfg["model"],
|
||||
@@ -263,13 +297,15 @@ def caption(payload: Dict[str, Any]) -> Dict[str, Any]:
|
||||
warning = str(error)
|
||||
facts = "(사진 판독 실패 — 메모와 입력값만 사용)"
|
||||
|
||||
tone = str(payload.get("tone") or DEFAULT_TONE)
|
||||
user = json.dumps({
|
||||
"어투": (TONES.get(tone) or TONES[DEFAULT_TONE])["label"],
|
||||
"사진에서_읽은_것": facts,
|
||||
"사용자_메모": note or "(없음)",
|
||||
"이미_정해진_값": known,
|
||||
"요청": "이 작품의 제목·부제·이미지 설명·본문을 쓴다. 값이 정해진 항목은 그대로 따른다.",
|
||||
}, ensure_ascii=False, indent=2)
|
||||
result = _ai_json(WRITE_SYSTEM, user)
|
||||
result = _ai_json(tone_system(tone), user)
|
||||
data = result["data"] or {}
|
||||
slug = re.sub(r"[^a-z0-9-]+", "-", str(data.get("slug") or "").lower()).strip("-")
|
||||
draft = {
|
||||
|
||||
@@ -40,6 +40,7 @@ DEFAULT_MOBILE = os.environ.get("TEAMAT_DEFAULT_PAGE", "").strip().lower() in ("
|
||||
TOKEN_FILE = Path(os.environ.get("TEAMAT_CONFIG_DIR") or (Path.home() / ".config" / "teamat-studio")) / "token"
|
||||
|
||||
import register as reg # 휴대폰 등록 흐름(사진 인박스·판독·발행)
|
||||
import update as upd # 등록된 작품 고치기
|
||||
|
||||
LIST_KEYS = {"gallery"}
|
||||
|
||||
@@ -433,12 +434,103 @@ def revert(sha: str, redeploy: bool) -> Dict[str, Any]:
|
||||
return {"ok": False, "error": "되돌린 뒤 빌드 실패", "log": build_log}
|
||||
result: Dict[str, Any] = {"ok": True, "message": f"{sha} 되돌림", "head": head_sha(), "log": build_log}
|
||||
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()
|
||||
result["deploy"] = {"ok": deployed, "log": deploy_log}
|
||||
result["deployed"] = deployed
|
||||
result["deploy_log"] = deploy_log[-400:]
|
||||
result["message"] += " · 배포 완료" if deployed else " (배포 실패)"
|
||||
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]:
|
||||
"""이미지는 assets/img/<작품슬러그>/ 에 넣는다. 작품마다 폴더 하나."""
|
||||
if not data:
|
||||
@@ -739,7 +831,9 @@ class Handler(BaseHTTPRequestHandler):
|
||||
self.send_body(200, target.read_bytes(), ctype)
|
||||
return
|
||||
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
|
||||
if path == "/api/state":
|
||||
rows = summaries()
|
||||
@@ -817,6 +911,28 @@ class Handler(BaseHTTPRequestHandler):
|
||||
except RuntimeError as error:
|
||||
self.send_json({"ok": False, "error": str(error)}, 502)
|
||||
return
|
||||
if path == "/api/tone":
|
||||
payload = self.read_json()
|
||||
try:
|
||||
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()
|
||||
@@ -824,8 +940,12 @@ class Handler(BaseHTTPRequestHandler):
|
||||
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": log[-500:], "head": head_sha()})
|
||||
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}
|
||||
@@ -838,6 +958,17 @@ class Handler(BaseHTTPRequestHandler):
|
||||
except (RuntimeError, FileNotFoundError) as error:
|
||||
self.send_json({"ok": False, "error": str(error)}, 500)
|
||||
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":
|
||||
try:
|
||||
self.send_json(save_product(self.read_json()))
|
||||
|
||||
@@ -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")}
|
||||
@@ -9,6 +9,7 @@
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500&family=Noto+Serif+KR:wght@400;600&display=swap" rel="stylesheet">
|
||||
<link rel="canonical" href="{{canonical}}">
|
||||
<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">
|
||||
<meta property="og:title" content="{{og_title}}">
|
||||
@@ -26,10 +27,10 @@
|
||||
<span class="wordmark-en">{{brand_name_en}}</span>
|
||||
</a>
|
||||
<nav class="nav" aria-label="주요">
|
||||
<a href="{{home}}index.html#works">작품</a>
|
||||
<a href="{{home}}index.html#process">과정</a>
|
||||
<a href="{{home}}index.html#kit">키트</a>
|
||||
<a href="{{home}}index.html#contact">문의</a>
|
||||
<a href="{{home}}#works">작품</a>
|
||||
<a href="{{home}}#process">과정</a>
|
||||
<a href="{{home}}#kit">키트</a>
|
||||
<a href="{{home}}#contact">문의</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<h3>{{title}}</h3>
|
||||
<p class="work-sub">{{subtitle}}</p>
|
||||
<p class="work-price">{{price_text}}</p>
|
||||
{{sold_html}}
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
@@ -50,6 +49,76 @@
|
||||
</div>
|
||||
</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">
|
||||
<div class="shell">
|
||||
<header class="section-head">
|
||||
|
||||
@@ -2,17 +2,30 @@
|
||||
<a class="back-link" href="../index.html#works">← 작품 목록</a>
|
||||
</div>
|
||||
|
||||
<article class="product shell">
|
||||
<div class="product-top">
|
||||
<figure class="product-media">
|
||||
<img src="../{{image}}" alt="{{alt}}" width="{{width}}" height="{{height}}" loading="eager" fetchpriority="high" decoding="async">
|
||||
</figure>
|
||||
<article class="product">
|
||||
<header class="product-head shell">
|
||||
<h1 class="product-title">{{title}}</h1>
|
||||
<p class="product-sub">{{subtitle}}</p>
|
||||
<p class="product-head-price">{{price_text}}</p>
|
||||
{{price_note_html}}
|
||||
</header>
|
||||
|
||||
<div class="product-info">
|
||||
<h1>{{title}}</h1>
|
||||
<p class="product-sub">{{subtitle}}</p>
|
||||
<p class="product-price">{{price_text}}</p>
|
||||
{{price_note_html}}
|
||||
<figure class="product-hero">
|
||||
<img src="../{{image}}" alt="{{alt}}" width="{{width}}" height="{{height}}" loading="eager" fetchpriority="high" decoding="async">
|
||||
</figure>
|
||||
|
||||
{{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}}
|
||||
{{buy_html}}
|
||||
<a class="studio-edit" href="http://localhost:8081/?slug={{slug}}" hidden>이 작품 고치기</a>
|
||||
@@ -32,17 +45,9 @@
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="product-story">
|
||||
<p class="label">STORY</p>
|
||||
<div class="prose">
|
||||
{{body_html}}
|
||||
</div>
|
||||
{{gallery_html}}
|
||||
</div>
|
||||
|
||||
<nav class="pager" aria-label="다른 작품">
|
||||
<nav class="pager shell" aria-label="다른 작품">
|
||||
<div class="pager-slot pager-prev">{{prev_html}}</div>
|
||||
<div class="pager-slot pager-next">{{next_html}}</div>
|
||||
</nav>
|
||||
|
||||