작품 목록 분리: 판매 중 / 판매 완료(카톡 제작 문의 버튼)

This commit is contained in:
한땀 작업실 committed 2026-11-01 04:56:29 +00:00
1 parent aba5d4d6e2
commit b803ab4efd
6 files changed
+157 -8

No files matched your search

+1
View File
@@ -113,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/` 에 둔다.
+8
View File
@@ -106,6 +106,14 @@ bash scripts/studio.sh # http://localhost:8081
비상용: 아이맥에서만 돌리는 예전 방식도 남아 있다. `bash scripts/studio-service.sh install`(launchd) + `tailscale serve --bg 8081` → `https://imac.taild8883.ts.net/m`. 지금은 꺼 둔다. 비상용: 아이맥에서만 돌리는 예전 방식도 남아 있다. `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(구매 버튼 + 소재·규격·세탁). ① 작은 제목·부제·가격 → ② 메인 사진(자르지 않고 폭 1080px) → ③ 서브 사진(한 열) → ④ 스토리 → ⑤ DETAILS(구매 버튼 + 소재·규격·세탁).
+48
View File
@@ -962,6 +962,54 @@ strong {
line-height: 1.6; line-height: 1.6;
} }
/* ------------------------------------------------------------ sold out */
.soldout .section-head {
border-top: 1px solid var(--line);
padding-top: clamp(36px, 5vw, 64px);
}
.soldout {
margin-top: clamp(56px, 8vw, 112px);
}
.work.is-sold .work-figure img {
filter: saturate(0.86);
opacity: 0.92;
}
.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;
}
.inquiry-btn:hover {
background: var(--sage);
border-color: var(--sage);
}
.inquiry-note {
margin-top: 8px;
color: var(--muted);
font-size: 12px;
line-height: 1.6;
}
.detail-body .inquiry-btn {
margin-top: 18px;
}
.pager { .pager {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
+15 -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
@@ -479,7 +481,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 +534,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:
@@ -591,6 +603,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 "—",
+12 -3
View File
@@ -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": "재고가 없는 작품입니다. 같은 무늬로 다시 만들 수 있어요 — 카톡으로 문의하시면 제작 일정과 값을 함께 알려 드립니다."
} }
+73 -3
View File
@@ -25,8 +25,8 @@
<section class="section works" id="works" aria-labelledby="works-title"> <section class="section works" id="works" aria-labelledby="works-title">
<div class="shell"> <div class="shell">
<header class="section-head"> <header class="section-head">
<p class="label">WORKS</p> <p class="label">FOR SALE</p>
<h2 id="works-title">작품</h2> <h2 id="works-title">판매 중인 작품</h2>
<p class="section-note">{{works_note}}</p> <p class="section-note">{{works_note}}</p>
</header> </header>
@@ -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,77 @@
</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 + " 재제작 문의드립니다.
"
+ "- 원하는 시기:
"
+ "- 크기·색상:
"
+ "- 문의 내용: ";
};
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">