1차 사이트: 첫 페이지·작품 3점·제작 과정·키트 안내
This commit is contained in:
1 parent
9b952f0867
commit
2f22e71ea4
16 files changed
+2323
No files matched your search
+1235
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,679 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""한땀 정적 사이트 빌드.
|
||||||
|
|
||||||
|
content/ + templates/ + assets/ -> dist/
|
||||||
|
표준 라이브러리만 쓴다. 템플릿은 {{key}} 치환과 목록 반복만 지원한다.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import html
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Any, Dict, Iterable, List, Optional, Tuple
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parent
|
||||||
|
CONTENT = ROOT / "content"
|
||||||
|
TEMPLATES = ROOT / "templates"
|
||||||
|
ASSETS = ROOT / "assets"
|
||||||
|
DIST = ROOT / "dist"
|
||||||
|
SITE_BASE = "https://home.lala.dedyn.io/teamat/"
|
||||||
|
|
||||||
|
VAR_RE = re.compile(r"{{\s*(\w+)\s*}}")
|
||||||
|
LOOP_RE = re.compile(r"{{#(\w+)}}(.*?){{/\1}}", re.S)
|
||||||
|
BOLD_RE = re.compile(r"\*\*(.+?)\*\*")
|
||||||
|
IMAGE_LINE_RE = re.compile(r"^!\[(.*?)\]\((.+?)\)$")
|
||||||
|
|
||||||
|
|
||||||
|
def esc(value: Any) -> str:
|
||||||
|
return html.escape(str(value), quote=True)
|
||||||
|
|
||||||
|
|
||||||
|
def fail(message: str) -> None:
|
||||||
|
print(f"빌드 오류: {message}", file=sys.stderr)
|
||||||
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------- front matter
|
||||||
|
|
||||||
|
|
||||||
|
def parse_scalar(value: str) -> Any:
|
||||||
|
value = value.strip()
|
||||||
|
if value in ("true", "false"):
|
||||||
|
return value == "true"
|
||||||
|
if value in ("", '""', "''"):
|
||||||
|
return ""
|
||||||
|
if re.fullmatch(r"-?\d+", value):
|
||||||
|
return int(value)
|
||||||
|
if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):
|
||||||
|
return value[1:-1]
|
||||||
|
return value
|
||||||
|
|
||||||
|
|
||||||
|
def parse_markdown_file(path: Path) -> Tuple[Dict[str, Any], str]:
|
||||||
|
raw = path.read_text(encoding="utf-8")
|
||||||
|
if not raw.startswith("---"):
|
||||||
|
fail(f"{path} 파일이 --- 로 시작하지 않습니다.")
|
||||||
|
|
||||||
|
parts = raw.split("---", 2)
|
||||||
|
if len(parts) != 3:
|
||||||
|
fail(f"{path} 파일의 front matter가 닫히지 않았습니다.")
|
||||||
|
|
||||||
|
front, body = parts[1], parts[2].lstrip("\n")
|
||||||
|
data: Dict[str, Any] = {}
|
||||||
|
current_key: Optional[str] = None
|
||||||
|
|
||||||
|
for line in front.splitlines():
|
||||||
|
if not line.strip() or line.lstrip().startswith("#"):
|
||||||
|
continue
|
||||||
|
|
||||||
|
stripped = line.strip()
|
||||||
|
if stripped.startswith("- ") and current_key:
|
||||||
|
if data.get(current_key) is None:
|
||||||
|
data[current_key] = []
|
||||||
|
if not isinstance(data[current_key], list):
|
||||||
|
fail(f"{path} 의 {current_key} 는 목록이 아닙니다.")
|
||||||
|
data[current_key].append(parse_scalar(stripped[2:]))
|
||||||
|
continue
|
||||||
|
|
||||||
|
if ":" not in line:
|
||||||
|
fail(f"{path} 의 front matter 줄을 읽을 수 없습니다: {line}")
|
||||||
|
|
||||||
|
key, value = line.split(":", 1)
|
||||||
|
key = key.strip()
|
||||||
|
value = value.strip()
|
||||||
|
if value == "":
|
||||||
|
data[key] = None
|
||||||
|
current_key = key
|
||||||
|
else:
|
||||||
|
data[key] = parse_scalar(value)
|
||||||
|
current_key = None
|
||||||
|
|
||||||
|
for key, value in list(data.items()):
|
||||||
|
if value is None:
|
||||||
|
data[key] = ""
|
||||||
|
|
||||||
|
return data, body
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------- markdown
|
||||||
|
|
||||||
|
|
||||||
|
def inline_markdown(text: str) -> str:
|
||||||
|
return BOLD_RE.sub(r"<strong>\1</strong>", esc(text))
|
||||||
|
|
||||||
|
|
||||||
|
def markdown_to_html(text: str, img_prefix: str = "") -> str:
|
||||||
|
lines = text.replace("\r\n", "\n").split("\n")
|
||||||
|
out: List[str] = []
|
||||||
|
paragraph: List[str] = []
|
||||||
|
index = 0
|
||||||
|
|
||||||
|
def flush_paragraph() -> None:
|
||||||
|
if paragraph:
|
||||||
|
out.append("<p>" + inline_markdown(" ".join(paragraph)) + "</p>")
|
||||||
|
paragraph.clear()
|
||||||
|
|
||||||
|
while index < len(lines):
|
||||||
|
line = lines[index].strip()
|
||||||
|
|
||||||
|
if not line:
|
||||||
|
flush_paragraph()
|
||||||
|
index += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
if line.startswith("## "):
|
||||||
|
flush_paragraph()
|
||||||
|
out.append("<h2>" + inline_markdown(line[3:].strip()) + "</h2>")
|
||||||
|
index += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
if line.startswith("- "):
|
||||||
|
flush_paragraph()
|
||||||
|
items: List[str] = []
|
||||||
|
while index < len(lines) and lines[index].strip().startswith("- "):
|
||||||
|
items.append("<li>" + inline_markdown(lines[index].strip()[2:].strip()) + "</li>")
|
||||||
|
index += 1
|
||||||
|
out.append("<ul>" + "".join(items) + "</ul>")
|
||||||
|
continue
|
||||||
|
|
||||||
|
image_match = IMAGE_LINE_RE.match(line)
|
||||||
|
if image_match:
|
||||||
|
flush_paragraph()
|
||||||
|
alt, src = image_match.group(1), image_match.group(2).strip()
|
||||||
|
out.append(
|
||||||
|
'<figure><img src="'
|
||||||
|
+ esc(img_prefix + src.lstrip("/"))
|
||||||
|
+ '" alt="'
|
||||||
|
+ esc(alt)
|
||||||
|
+ '" loading="lazy" decoding="async"></figure>'
|
||||||
|
)
|
||||||
|
index += 1
|
||||||
|
continue
|
||||||
|
|
||||||
|
paragraph.append(line)
|
||||||
|
index += 1
|
||||||
|
|
||||||
|
flush_paragraph()
|
||||||
|
return "\n".join(out)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------------------------------------------------------------- images
|
||||||
|
|
||||||
|
|
||||||
|
def jpeg_size(path: Path) -> Tuple[int, int]:
|
||||||
|
data = path.read_bytes()
|
||||||
|
if data[:2] != b"\xff\xd8":
|
||||||
|
fail(f"JPEG 파일이 아닙니다: {path}")
|
||||||
|
|
||||||
|
sof_markers = set(range(0xC0, 0xC4)) | set(range(0xC5, 0xC8)) | set(range(0xC9, 0xCC)) | set(range(0xCD, 0xD0))
|
||||||
|
pos = 2
|
||||||
|
while pos + 9 < len(data):
|
||||||
|
if data[pos] != 0xFF:
|
||||||
|
pos += 1
|
||||||
|
continue
|
||||||
|
marker = data[pos + 1]
|
||||||
|
if marker in (0xD8, 0xD9):
|
||||||
|
pos += 2
|
||||||
|
continue
|
||||||
|
length = int.from_bytes(data[pos + 2 : pos + 4], "big")
|
||||||
|
if marker in sof_markers:
|
||||||
|
height = int.from_bytes(data[pos + 5 : pos + 7], "big")
|
||||||
|
width = int.from_bytes(data[pos + 7 : pos + 9], "big")
|
||||||
|
return width, height
|
||||||
|
pos += 2 + length
|
||||||
|
|
||||||
|
fail(f"이미지 크기를 읽을 수 없습니다: {path}")
|
||||||
|
|
||||||
|
|
||||||
|
_image_sizes: Dict[str, Tuple[int, int]] = {}
|
||||||
|
|
||||||
|
|
||||||
|
def image_size(rel_path: str) -> Tuple[int, int]:
|
||||||
|
if not rel_path:
|
||||||
|
fail("이미지 경로가 비어 있습니다.")
|
||||||
|
if rel_path.startswith(("http://", "https://", "/")):
|
||||||
|
fail(f"이미지 경로는 상대경로여야 합니다: {rel_path}")
|
||||||
|
if rel_path not in _image_sizes:
|
||||||
|
path = ROOT / rel_path
|
||||||
|
if not path.is_file():
|
||||||
|
fail(f"이미지 파일이 없습니다: {rel_path}")
|
||||||
|
_image_sizes[rel_path] = jpeg_size(path)
|
||||||
|
return _image_sizes[rel_path]
|
||||||
|
|
||||||
|
|
||||||
|
def img_tag(
|
||||||
|
rel_path: str,
|
||||||
|
alt: str,
|
||||||
|
*,
|
||||||
|
prefix: str = "",
|
||||||
|
loading: str = "lazy",
|
||||||
|
priority: bool = False,
|
||||||
|
) -> str:
|
||||||
|
width, height = image_size(rel_path)
|
||||||
|
extra = ' fetchpriority="high"' if priority else ""
|
||||||
|
return (
|
||||||
|
f'<img src="{esc(prefix + rel_path)}" alt="{esc(alt)}" '
|
||||||
|
f'width="{width}" height="{height}" loading="{esc(loading)}" '
|
||||||
|
f'decoding="async"{extra}>'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def figure_html(
|
||||||
|
rel_path: str,
|
||||||
|
alt: str,
|
||||||
|
css_class: str,
|
||||||
|
*,
|
||||||
|
prefix: str = "",
|
||||||
|
loading: str = "lazy",
|
||||||
|
priority: bool = False,
|
||||||
|
) -> str:
|
||||||
|
return (
|
||||||
|
f'<figure class="{esc(css_class)}">'
|
||||||
|
+ img_tag(rel_path, alt, prefix=prefix, loading=loading, priority=priority)
|
||||||
|
+ "</figure>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def absolute_url(rel_path: str) -> str:
|
||||||
|
return SITE_BASE + rel_path.lstrip("/")
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------- helpers
|
||||||
|
|
||||||
|
|
||||||
|
def format_price(value: Any) -> str:
|
||||||
|
if value is None or value == "":
|
||||||
|
return "문의"
|
||||||
|
if isinstance(value, int):
|
||||||
|
return f"{value:,}원"
|
||||||
|
return esc(value)
|
||||||
|
|
||||||
|
|
||||||
|
def collapse(text: str) -> str:
|
||||||
|
return re.sub(r"\s+", " ", text).strip()
|
||||||
|
|
||||||
|
|
||||||
|
def render(template: str, context: Dict[str, Any], name: str = "template") -> str:
|
||||||
|
def replace_loop(match: re.Match) -> str:
|
||||||
|
key, body = match.group(1), match.group(2)
|
||||||
|
items = context.get(key, [])
|
||||||
|
if items in (None, ""):
|
||||||
|
items = []
|
||||||
|
if not isinstance(items, Iterable) or isinstance(items, (str, bytes, dict)):
|
||||||
|
fail(f"{name} 의 {key} 는 목록이어야 합니다.")
|
||||||
|
rendered: List[str] = []
|
||||||
|
for item in items:
|
||||||
|
local = dict(context)
|
||||||
|
if isinstance(item, dict):
|
||||||
|
local.update(item)
|
||||||
|
else:
|
||||||
|
local["text"] = item
|
||||||
|
rendered.append(VAR_RE.sub(lambda m: str(local.get(m.group(1), "")), body))
|
||||||
|
return "".join(rendered)
|
||||||
|
|
||||||
|
output = LOOP_RE.sub(replace_loop, template)
|
||||||
|
output = VAR_RE.sub(lambda m: str(context.get(m.group(1), "")), output)
|
||||||
|
|
||||||
|
leftover = re.search(r"{{[^}]+}}", output)
|
||||||
|
if leftover:
|
||||||
|
fail(f"{name} 에 치환되지 않은 값이 있습니다: {leftover.group(0)}")
|
||||||
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
def load_products() -> List[Dict[str, Any]]:
|
||||||
|
products: List[Dict[str, Any]] = []
|
||||||
|
for path in sorted((CONTENT / "products").glob("*.md")):
|
||||||
|
data, body = parse_markdown_file(path)
|
||||||
|
slug = str(data.get("slug", "")).strip()
|
||||||
|
if not slug:
|
||||||
|
fail(f"{path.name} 에 slug 가 없습니다.")
|
||||||
|
if slug != path.stem:
|
||||||
|
fail(f"{path.name} 의 slug({slug})가 파일명과 다릅니다.")
|
||||||
|
data["slug"] = slug
|
||||||
|
data["body"] = body
|
||||||
|
data["_path"] = path
|
||||||
|
image_size(str(data.get("image", "")))
|
||||||
|
gallery = data.get("gallery") or []
|
||||||
|
if not isinstance(gallery, list):
|
||||||
|
fail(f"{path.name} 의 gallery 는 목록이어야 합니다.")
|
||||||
|
for gallery_image in gallery:
|
||||||
|
image_size(str(gallery_image))
|
||||||
|
products.append(data)
|
||||||
|
|
||||||
|
if not products:
|
||||||
|
fail("content/products 에 작품이 없습니다.")
|
||||||
|
return products
|
||||||
|
|
||||||
|
|
||||||
|
def sort_products(products: List[Dict[str, Any]], order: str) -> List[Dict[str, Any]]:
|
||||||
|
reverse = order != "oldest"
|
||||||
|
return sorted(products, key=lambda p: (str(p.get("date", "")), p["slug"]), reverse=reverse)
|
||||||
|
|
||||||
|
|
||||||
|
def load_process() -> List[Dict[str, Any]]:
|
||||||
|
steps: List[Dict[str, Any]] = []
|
||||||
|
for path in sorted((CONTENT / "process").glob("*.md")):
|
||||||
|
data, body = parse_markdown_file(path)
|
||||||
|
if data.get("step") in ("", None):
|
||||||
|
fail(f"{path.name} 에 step 이 없습니다.")
|
||||||
|
data["step"] = int(data["step"])
|
||||||
|
data["body"] = body
|
||||||
|
if data.get("image"):
|
||||||
|
image_size(str(data["image"]))
|
||||||
|
steps.append(data)
|
||||||
|
if not steps:
|
||||||
|
fail("content/process 에 단계가 없습니다.")
|
||||||
|
return sorted(steps, key=lambda s: s["step"])
|
||||||
|
|
||||||
|
|
||||||
|
def build_shared(site: Dict[str, Any], home: str, asset_prefix: str) -> Dict[str, Any]:
|
||||||
|
brand = site["brand"]
|
||||||
|
contact = site["contact"]
|
||||||
|
email = str(contact.get("email", "")).strip()
|
||||||
|
instagram = str(contact.get("instagram", "")).strip()
|
||||||
|
|
||||||
|
if email:
|
||||||
|
email_href = "mailto:" + email
|
||||||
|
email_html = f'<a href="{esc(email_href)}">{esc(email)}</a>'
|
||||||
|
else:
|
||||||
|
email_href = ""
|
||||||
|
email_html = '<span class="pending-inline">메일 준비 중</span>'
|
||||||
|
|
||||||
|
if instagram:
|
||||||
|
instagram_link = f'<a href="{esc(instagram)}" rel="noopener">인스타그램</a>'
|
||||||
|
else:
|
||||||
|
instagram_link = '<span class="pending-inline">인스타그램 준비 중</span>'
|
||||||
|
|
||||||
|
credits = [
|
||||||
|
{
|
||||||
|
"title": esc(item.get("title", "")),
|
||||||
|
"author": esc(item.get("author", "")),
|
||||||
|
"license": esc(item.get("license", "")),
|
||||||
|
}
|
||||||
|
for item in site.get("image_credits", [])
|
||||||
|
]
|
||||||
|
|
||||||
|
return {
|
||||||
|
"brand_name": esc(brand["name"]),
|
||||||
|
"brand_name_en": esc(brand["name_en"]),
|
||||||
|
"tagline": esc(brand["tagline"]),
|
||||||
|
"since": esc(brand["since"]),
|
||||||
|
"footer_note": esc(site.get("footer_note", "")),
|
||||||
|
"contact_email": esc(email) if email else "",
|
||||||
|
"email_href": esc(email_href) if email_href else "",
|
||||||
|
"email_html": email_html,
|
||||||
|
"instagram_link": instagram_link,
|
||||||
|
"credits": credits,
|
||||||
|
"home": home,
|
||||||
|
"asset_prefix": asset_prefix,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def product_loop_items(products: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
||||||
|
items: List[Dict[str, Any]] = []
|
||||||
|
for product in products:
|
||||||
|
image = str(product["image"])
|
||||||
|
width, height = image_size(image)
|
||||||
|
sold_html = '<p class="work-sold">판매 완료</p>' if product.get("sold_out") else ""
|
||||||
|
items.append(
|
||||||
|
{
|
||||||
|
"href": f"p/{product['slug']}.html",
|
||||||
|
"image": esc(image),
|
||||||
|
"alt": esc(product.get("image_alt") or product["title"]),
|
||||||
|
"width": str(width),
|
||||||
|
"height": str(height),
|
||||||
|
"title": esc(product["title"]),
|
||||||
|
"subtitle": esc(product.get("subtitle", "")),
|
||||||
|
"price_text": format_price(product.get("price")),
|
||||||
|
"sold_html": sold_html,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
def process_loop_items(steps: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
||||||
|
items: List[Dict[str, Any]] = []
|
||||||
|
for step in steps:
|
||||||
|
image = str(step.get("image", ""))
|
||||||
|
if image:
|
||||||
|
image_html = figure_html(
|
||||||
|
image,
|
||||||
|
str(step.get("image_alt") or step["title"]),
|
||||||
|
"step-figure",
|
||||||
|
)
|
||||||
|
step_class = "process-step has-image"
|
||||||
|
else:
|
||||||
|
image_html = ""
|
||||||
|
step_class = "process-step no-image"
|
||||||
|
items.append(
|
||||||
|
{
|
||||||
|
"step": str(step["step"]),
|
||||||
|
"title": esc(step["title"]),
|
||||||
|
"body_html": markdown_to_html(step["body"]),
|
||||||
|
"image_html": image_html,
|
||||||
|
"step_class": step_class,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
def build_index(
|
||||||
|
site: Dict[str, Any],
|
||||||
|
products: List[Dict[str, Any]],
|
||||||
|
steps: List[Dict[str, Any]],
|
||||||
|
shared: Dict[str, Any],
|
||||||
|
brand: Dict[str, Any],
|
||||||
|
) -> str:
|
||||||
|
featured = next((p for p in products if p.get("featured")), products[0])
|
||||||
|
hero_image = str(featured["image"])
|
||||||
|
hero_width, hero_height = image_size(hero_image)
|
||||||
|
|
||||||
|
kit = next((p for p in products if p["slug"] == "kit-first-stitch"), None)
|
||||||
|
if kit is None:
|
||||||
|
fail("content/products/kit-first-stitch.md 가 필요합니다.")
|
||||||
|
kit_image = str(kit["image"])
|
||||||
|
kit_width, kit_height = image_size(kit_image)
|
||||||
|
kit_body_html = markdown_to_html(kit["body"])
|
||||||
|
kit_excerpt = kit_body_html.split("</p>", 1)[0] + "</p>" if "</p>" in kit_body_html else kit_body_html
|
||||||
|
|
||||||
|
kit_url = str(site.get("shop", {}).get("kit_url", "")).strip()
|
||||||
|
if kit_url:
|
||||||
|
kit_action = f'<a class="btn" href="{esc(kit_url)}" rel="noopener">네이버에서 키트 구매</a>'
|
||||||
|
else:
|
||||||
|
kit_action = '<p class="pending pending-invert">네이버 스마트스토어 준비 중</p>'
|
||||||
|
|
||||||
|
store_url = str(site.get("shop", {}).get("store_url", "")).strip()
|
||||||
|
if store_url:
|
||||||
|
store_note = (
|
||||||
|
f'<a class="text-link" href="{esc(store_url)}" rel="noopener">네이버 스마트스토어</a>'
|
||||||
|
"에서 주문하실 수 있습니다."
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
store_note = "온라인 주문은 준비 중입니다. 작품과 키트 문의는 메일로 받습니다."
|
||||||
|
|
||||||
|
intro = collapse(brand["intro"])
|
||||||
|
title = f"{brand['name']} — {brand['tagline']}"
|
||||||
|
context: Dict[str, Any] = dict(shared)
|
||||||
|
context.update(
|
||||||
|
{
|
||||||
|
"title": esc(title),
|
||||||
|
"description": esc(intro),
|
||||||
|
"og_title": esc(title),
|
||||||
|
"og_description": esc(intro),
|
||||||
|
"og_image": esc(absolute_url(hero_image)),
|
||||||
|
"og_type": "website",
|
||||||
|
"body_class": "is-home",
|
||||||
|
"intro": esc(intro),
|
||||||
|
"hero_image": esc(hero_image),
|
||||||
|
"hero_alt": esc(featured.get("image_alt") or featured["title"]),
|
||||||
|
"hero_width": str(hero_width),
|
||||||
|
"hero_height": str(hero_height),
|
||||||
|
"hero_title": esc(featured["title"]),
|
||||||
|
"hero_material": esc(featured.get("material", "")),
|
||||||
|
"hero_href": f"p/{featured['slug']}.html",
|
||||||
|
"products": product_loop_items(products),
|
||||||
|
"process": process_loop_items(steps),
|
||||||
|
"process_intro": esc(site.get("process_intro", "")),
|
||||||
|
"kit_title": esc(kit["title"]),
|
||||||
|
"kit_subtitle": esc(kit.get("subtitle", "")),
|
||||||
|
"kit_excerpt": kit_excerpt,
|
||||||
|
"kit_note": esc(site.get("shop", {}).get("kit_note", "")),
|
||||||
|
"kit_price": format_price(kit.get("price")),
|
||||||
|
"kit_action": kit_action,
|
||||||
|
"kit_href": f"p/{kit['slug']}.html",
|
||||||
|
"kit_image": esc(kit_image),
|
||||||
|
"kit_alt": esc(kit.get("image_alt") or kit["title"]),
|
||||||
|
"kit_width": str(kit_width),
|
||||||
|
"kit_height": str(kit_height),
|
||||||
|
"shipping": [{"text": esc(item)} for item in site.get("shipping", [])],
|
||||||
|
"care": [{"text": esc(item)} for item in site.get("care", [])],
|
||||||
|
"store_note": store_note,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
body = render((TEMPLATES / "index.html").read_text(encoding="utf-8"), context, "index.html")
|
||||||
|
context["content"] = body
|
||||||
|
return render((TEMPLATES / "base.html").read_text(encoding="utf-8"), context, "base.html")
|
||||||
|
|
||||||
|
|
||||||
|
def pager_html(product: Optional[Dict[str, Any]], label: str, css_class: str) -> str:
|
||||||
|
if product is None:
|
||||||
|
return ""
|
||||||
|
return (
|
||||||
|
f'<a class="{css_class}" href="{esc(product["slug"])}.html">'
|
||||||
|
f'<span class="pager-label">{esc(label)}</span>'
|
||||||
|
f'<span class="pager-title">{esc(product["title"])}</span>'
|
||||||
|
"</a>"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def build_product_page(
|
||||||
|
product: Dict[str, Any],
|
||||||
|
products: List[Dict[str, Any]],
|
||||||
|
shared: Dict[str, Any],
|
||||||
|
brand: Dict[str, Any],
|
||||||
|
index: int,
|
||||||
|
) -> str:
|
||||||
|
image = str(product["image"])
|
||||||
|
width, height = image_size(image)
|
||||||
|
|
||||||
|
if product.get("sold_out"):
|
||||||
|
buy_html = '<p class="pending">판매 완료</p>'
|
||||||
|
else:
|
||||||
|
naver_url = str(product.get("naver_url", "")).strip()
|
||||||
|
if naver_url:
|
||||||
|
buy_html = f'<a class="btn" href="{esc(naver_url)}" rel="noopener">네이버 스토어에서 구매</a>'
|
||||||
|
else:
|
||||||
|
buy_html = (
|
||||||
|
'<button type="button" class="btn btn-disabled" disabled aria-disabled="true">'
|
||||||
|
"네이버 스토어 준비 중"
|
||||||
|
"</button>"
|
||||||
|
)
|
||||||
|
|
||||||
|
gallery = product.get("gallery") or []
|
||||||
|
gallery_figures: List[str] = []
|
||||||
|
for number, gallery_image in enumerate(gallery, start=1):
|
||||||
|
gallery_figures.append(
|
||||||
|
figure_html(
|
||||||
|
str(gallery_image),
|
||||||
|
f"{product['title']} 추가 이미지 {number}",
|
||||||
|
"gallery-figure",
|
||||||
|
prefix="../",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
gallery_html = '<div class="gallery">' + "".join(gallery_figures) + "</div>" if gallery_figures else ""
|
||||||
|
|
||||||
|
prev_product = products[index - 1] if index > 0 else None
|
||||||
|
next_product = products[index + 1] if index + 1 < len(products) else None
|
||||||
|
list_fallback = (
|
||||||
|
'<a class="pager-link pager-list" href="../index.html#works">'
|
||||||
|
'<span class="pager-label">목록</span>'
|
||||||
|
'<span class="pager-title">모든 작품</span>'
|
||||||
|
"</a>"
|
||||||
|
)
|
||||||
|
|
||||||
|
subtitle = str(product.get("subtitle", "")).strip()
|
||||||
|
material = str(product.get("material", "")).strip()
|
||||||
|
description = ". ".join(part for part in (subtitle, material) if part)
|
||||||
|
title = f"{product['title']} — {brand['name']}"
|
||||||
|
|
||||||
|
context: Dict[str, Any] = dict(shared)
|
||||||
|
context.update(
|
||||||
|
{
|
||||||
|
"title": esc(title),
|
||||||
|
"description": esc(description),
|
||||||
|
"og_title": esc(title),
|
||||||
|
"og_description": esc(description),
|
||||||
|
"og_image": esc(absolute_url(image)),
|
||||||
|
"og_type": "product",
|
||||||
|
"body_class": "is-product",
|
||||||
|
"image": esc(image),
|
||||||
|
"alt": esc(product.get("image_alt") or product["title"]),
|
||||||
|
"width": str(width),
|
||||||
|
"height": str(height),
|
||||||
|
"product_title": esc(product["title"]),
|
||||||
|
"title_text": esc(product["title"]),
|
||||||
|
"subtitle": esc(subtitle),
|
||||||
|
"price_text": format_price(product.get("price")),
|
||||||
|
"sold_html": '<p class="product-sold">판매 완료</p>' if product.get("sold_out") else "",
|
||||||
|
"buy_html": buy_html,
|
||||||
|
"material": esc(material) or "—",
|
||||||
|
"size": esc(product.get("size", "")) or "—",
|
||||||
|
"care": esc(product.get("care", "")) or "—",
|
||||||
|
"body_html": markdown_to_html(product["body"], img_prefix="../"),
|
||||||
|
"gallery_html": gallery_html,
|
||||||
|
"prev_html": pager_html(prev_product, "이전 작품", "pager-link pager-link-prev") or list_fallback,
|
||||||
|
"next_html": pager_html(next_product, "다음 작품", "pager-link pager-link-next") or list_fallback,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# {{title}} is used both by the page and by <title>. The base needs the full title;
|
||||||
|
# the product template needs only the work's name.
|
||||||
|
template = (TEMPLATES / "product.html").read_text(encoding="utf-8")
|
||||||
|
body_context = dict(context)
|
||||||
|
body_context["title"] = esc(product["title"])
|
||||||
|
body_context["title_text"] = esc(product["title"])
|
||||||
|
body = render(template, body_context, f"product {product['slug']}")
|
||||||
|
context["content"] = body
|
||||||
|
return render((TEMPLATES / "base.html").read_text(encoding="utf-8"), context, "base.html")
|
||||||
|
|
||||||
|
|
||||||
|
def verify_dist(products: List[Dict[str, Any]]) -> None:
|
||||||
|
pages = [DIST / "index.html", *sorted((DIST / "p").glob("*.html"))]
|
||||||
|
errors: List[str] = []
|
||||||
|
images = 0
|
||||||
|
|
||||||
|
for page in pages:
|
||||||
|
text = page.read_text(encoding="utf-8")
|
||||||
|
images += len(re.findall(r"<img\s", text))
|
||||||
|
for attr in re.findall(r'(?:href|src)="([^"]+)"', text):
|
||||||
|
attr = html.unescape(attr)
|
||||||
|
if attr.startswith(("http://", "https://", "mailto:", "data:", "tel:", "#")):
|
||||||
|
continue
|
||||||
|
target = attr.split("#", 1)[0]
|
||||||
|
if not target:
|
||||||
|
continue
|
||||||
|
resolved = (page.parent / target).resolve()
|
||||||
|
if not resolved.exists():
|
||||||
|
errors.append(f"{page.relative_to(DIST)} -> {attr}")
|
||||||
|
|
||||||
|
if errors:
|
||||||
|
for error in errors:
|
||||||
|
print(f"깨진 경로: {error}", file=sys.stderr)
|
||||||
|
fail(f"깨진 상대경로 {len(errors)}개")
|
||||||
|
|
||||||
|
index_text = (DIST / "index.html").read_text(encoding="utf-8")
|
||||||
|
work_links = sorted(set(re.findall(r'href="p/[^"]+\.html"', index_text)))
|
||||||
|
if len(work_links) < len(products):
|
||||||
|
fail("첫 페이지의 작품 링크 수가 작품 수보다 적습니다.")
|
||||||
|
|
||||||
|
print(f"검증: 페이지 {len(pages)}개, 이미지 {images}개, 깨진 상대경로 0개, 작품 링크 {len(work_links)}개")
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
try:
|
||||||
|
site = json.loads((CONTENT / "site.json").read_text(encoding="utf-8"))
|
||||||
|
except json.JSONDecodeError as error:
|
||||||
|
fail(f"content/site.json 문법 오류: {error}")
|
||||||
|
|
||||||
|
brand = site["brand"]
|
||||||
|
products_all = load_products()
|
||||||
|
products = sort_products(products_all, str(site.get("product_sort", "newest")))
|
||||||
|
steps = load_process()
|
||||||
|
|
||||||
|
shared_index = build_shared(site, home="", asset_prefix="")
|
||||||
|
shared_product = build_shared(site, home="../", asset_prefix="../")
|
||||||
|
|
||||||
|
index_html = build_index(site, products, steps, shared_index, brand)
|
||||||
|
|
||||||
|
product_pages = {
|
||||||
|
product["slug"]: build_product_page(product, products, shared_product, brand, position)
|
||||||
|
for position, product in enumerate(products)
|
||||||
|
}
|
||||||
|
|
||||||
|
if DIST.exists():
|
||||||
|
shutil.rmtree(DIST)
|
||||||
|
(DIST / "p").mkdir(parents=True)
|
||||||
|
shutil.copytree(
|
||||||
|
ASSETS,
|
||||||
|
DIST / "assets",
|
||||||
|
ignore=shutil.ignore_patterns(".DS_Store", "*.log", "__pycache__"),
|
||||||
|
)
|
||||||
|
|
||||||
|
(DIST / "index.html").write_text(index_html, encoding="utf-8")
|
||||||
|
for slug, page in product_pages.items():
|
||||||
|
(DIST / "p" / f"{slug}.html").write_text(page, encoding="utf-8")
|
||||||
|
|
||||||
|
verify_dist(products)
|
||||||
|
print("빌드 완료: dist/")
|
||||||
|
print(" dist/index.html")
|
||||||
|
for slug in product_pages:
|
||||||
|
print(f" dist/p/{slug}.html")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
step: 1
|
||||||
|
title: 천 고르기
|
||||||
|
image: assets/img/craft-jogakbo.jpg
|
||||||
|
image_alt: 여러 색 천 조각을 이어 붙인 조각보
|
||||||
|
---
|
||||||
|
린넨은 물에 한 번 담갔다 말려 수축을 빼고 시작합니다. 햇빛에 비춰 올이 고른 쪽, 빛을 고르게 받는 쪽을 고릅니다. 천의 폭이 좁으면 두 폭을 이어 붙입니다.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
step: 2
|
||||||
|
title: 도안 뜨기
|
||||||
|
---
|
||||||
|
먹지를 천 위에 놓고 목련이나 솔잎의 윤곽을 옮깁니다. 선은 연하게, 바늘이 지나갈 자리만 남깁니다. 도안이 단순할수록 천의 결이 살아납니다.
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
step: 3
|
||||||
|
title: 한 땀 놓기
|
||||||
|
image: assets/img/work-green-linen.jpg
|
||||||
|
image_alt: 성긴 직물 위에 녹색 실로 놓은 자수
|
||||||
|
---
|
||||||
|
실은 한 번에 길게 빼지 않습니다. 한 땀 놓고, 손을 내리고, 다시 바늘을 잡습니다. 꽃잎은 안쪽에서 바깥으로, 잎은 줄기에서 끝으로 놓습니다. 하루에 두어 시간이 지나면 손목이 먼저 쉬자고 합니다.
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
step: 4
|
||||||
|
title: 마감과 세탁
|
||||||
|
---
|
||||||
|
끝단을 접어 박음질하고, 뒤쪽 실은 짧게 정리합니다. 완성한 천은 미지근한 물에 중성세제로 단독 손세탁합니다. 그늘에서 뉘어 말리고, 다림질할 때는 천 위에 면포를 한 장 댑니다.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
slug: cedar-tea-mat
|
||||||
|
title: 솔잎 티매트
|
||||||
|
subtitle: 창가에 놓은 작은 숲
|
||||||
|
date: 2026-10-18
|
||||||
|
price: 62000
|
||||||
|
sold_out: false
|
||||||
|
featured: false
|
||||||
|
image: assets/img/work-green-linen.jpg
|
||||||
|
image_alt: 성긴 아이보리 직물 위에 녹색 실로 잎을 놓은 티매트
|
||||||
|
gallery:
|
||||||
|
material: 린넨 100%, 면사 자수
|
||||||
|
size: 32 × 48 cm
|
||||||
|
care: 미지근한 물에 중성세제로 단독 손세탁
|
||||||
|
naver_url: ""
|
||||||
|
---
|
||||||
|
성긴 린넨의 올 사이로 빛이 지나갑니다. 그 위에 녹색 면사로 솔잎을 길게 놓았습니다. 잎마다 방향을 조금씩 달리해, 같은 잎이 반복되지 않게 했습니다.
|
||||||
|
|
||||||
|
가장자리는 접어 박음질하고, 귀퉁이마다 실을 두 번 돌려 마무리했습니다. 티포트를 올리면 잎의 방향을 따라 그림자가 생깁니다.
|
||||||
|
|
||||||
|
한 점에 보름 남짓 걸렸습니다. 실의 색은 세 가지를 나란히 놓고 골랐습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
slug: kit-first-stitch
|
||||||
|
title: 처음 한 땀 티매트 키트
|
||||||
|
subtitle: 천과 실, 도안이 함께 오는 상자
|
||||||
|
date: 2026-10-05
|
||||||
|
price: 32000
|
||||||
|
sold_out: false
|
||||||
|
featured: false
|
||||||
|
image: assets/img/craft-jogakbo.jpg
|
||||||
|
image_alt: 여러 천 조각을 이어 붙인 조각보
|
||||||
|
gallery:
|
||||||
|
material: 린넨 천, 면사, 도안, 바늘
|
||||||
|
size: 완성 30 × 45 cm
|
||||||
|
care: 완성 후 미지근한 물에 단독 손세탁
|
||||||
|
naver_url: ""
|
||||||
|
---
|
||||||
|
완제품이 아닙니다. 천에 도안이 옅게 찍혀 있고, 실과 바늘이 함께 들어 있습니다. 도안을 따라 한 땀씩 놓으면 30 × 45 cm 티매트 한 장이 됩니다.
|
||||||
|
|
||||||
|
처음이면 가장자리부터 시작하세요. 실을 길게 빼지 않고, 한 땀 놓고 손을 한 번 내리는 리듬이 익숙해지면 안쪽으로 들어갑니다. 도안은 단순하게 그렸습니다. 천의 결을 가리지 않도록.
|
||||||
|
|
||||||
|
막히면 메일로 물어보셔도 됩니다. 사진 한 장을 보내주시면 어느 자리에서 멈췄는지 함께 봅니다.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
slug: whitework-tea-mat
|
||||||
|
title: 목련 한 땀 티매트
|
||||||
|
subtitle: 봄볕에 널어둔 천
|
||||||
|
date: 2026-10-28
|
||||||
|
price: 58000
|
||||||
|
sold_out: false
|
||||||
|
featured: true
|
||||||
|
image: assets/img/work-whitework.jpg
|
||||||
|
image_alt: 아이보리 린넨 위에 흰 실로 문양을 놓은 티매트
|
||||||
|
gallery:
|
||||||
|
material: 린넨 100%, 면사 자수
|
||||||
|
size: 30 × 45 cm
|
||||||
|
care: 미지근한 물에 중성세제로 단독 손세탁
|
||||||
|
naver_url: ""
|
||||||
|
---
|
||||||
|
아이보리 린넨 위에 흰 면사로 목련 한 송이를 놓았습니다. 꽃잎의 윤곽은 실을 두 번 겹쳐 놓고, 안쪽은 올을 풀어 비웠습니다.
|
||||||
|
|
||||||
|
가장자리는 실 한 올씩 풀어 올을 정리했습니다. 찻잔을 올리면 천의 결이 비쳐 보이고, 물기가 닿아도 금세 마릅니다.
|
||||||
|
|
||||||
|
한 점에 열흘 남짓 걸렸습니다. 하루에 두어 시간씩, 손이 가는 만큼 천천히 놓았습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"brand": {
|
||||||
|
"name": "한땀",
|
||||||
|
"name_en": "HAN TTAM",
|
||||||
|
"tagline": "천 위에, 한 땀씩.",
|
||||||
|
"intro": "한땀은 손으로 자수 티매트를 만드는 작은 작업실입니다. 아이보리 린넨과 무명 위에 면사로 그림을 놓습니다. 한 점을 시작하면 며칠에 걸쳐 한 땀씩 앉습니다.",
|
||||||
|
"since": "2026"
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"email": "hello@hanttam.kr",
|
||||||
|
"instagram": "",
|
||||||
|
"kakao": ""
|
||||||
|
},
|
||||||
|
"shop": {
|
||||||
|
"store_url": "",
|
||||||
|
"kit_url": "",
|
||||||
|
"kit_note": "린넨 천, 면사, 도안, 바늘 — 처음 시작하는 사람에게 필요한 것들"
|
||||||
|
},
|
||||||
|
"process_intro": "천을 고르고, 도안을 옮기고, 한 땀씩 놓아 마감하기까지. 서두르지 않고 네 단계로 만납니다.",
|
||||||
|
"shipping": [
|
||||||
|
"주문 후 3~5일 이내 제작·발송",
|
||||||
|
"택배비 3,000원 / 5만원 이상 무료"
|
||||||
|
],
|
||||||
|
"care": [
|
||||||
|
"미지근한 물에 중성세제로 단독 손세탁",
|
||||||
|
"그늘에서 뉘어 말리기",
|
||||||
|
"다림질은 천 위에 면포를 대고"
|
||||||
|
],
|
||||||
|
"product_sort": "newest",
|
||||||
|
"footer_note": "사업자등록번호와 통신판매업 신고 번호는 추후 기재합니다.",
|
||||||
|
"image_credits": [
|
||||||
|
{"title": "Linen towel with drawn threadwork and whitework embroidery", "author": "Wikimedia Commons", "license": "Public domain"},
|
||||||
|
{"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"}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
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/"
|
||||||
|
|
||||||
|
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
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "배포 완료: ${SITE_URL} (HTTP ${status})"
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
python3 build.py
|
||||||
|
echo
|
||||||
|
echo "미리보기: http://localhost:8080"
|
||||||
|
python3 -m http.server 8080 --directory dist
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
if [ "$#" -eq 0 ]; then
|
||||||
|
echo "마지막 커밋을 되돌립니다."
|
||||||
|
git revert --no-edit HEAD
|
||||||
|
else
|
||||||
|
echo "${1} 커밋을 되돌립니다."
|
||||||
|
git revert --no-edit "$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
python3 build.py
|
||||||
|
bash scripts/deploy.sh
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>{{title}}</title>
|
||||||
|
<meta name="description" content="{{description}}">
|
||||||
|
<meta name="theme-color" content="#F6F2EA">
|
||||||
|
<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="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}}">
|
||||||
|
<meta property="og:description" content="{{og_description}}">
|
||||||
|
<meta property="og:image" content="{{og_image}}">
|
||||||
|
<meta property="og:type" content="{{og_type}}">
|
||||||
|
</head>
|
||||||
|
<body class="{{body_class}}">
|
||||||
|
<a class="skip-link" href="#main">본문으로 건너뛰기</a>
|
||||||
|
|
||||||
|
<header class="site-head">
|
||||||
|
<div class="shell head-inner">
|
||||||
|
<a class="wordmark" href="{{home}}index.html" aria-label="{{brand_name}} 홈">
|
||||||
|
<span class="wordmark-ko">{{brand_name}}</span>
|
||||||
|
<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>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main id="main">
|
||||||
|
{{content}}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="site-foot">
|
||||||
|
<div class="shell">
|
||||||
|
<div class="foot-meta">
|
||||||
|
<p>{{footer_note}}</p>
|
||||||
|
<p class="foot-contact">
|
||||||
|
<a href="{{email_href}}">{{contact_email}}</a>
|
||||||
|
<span class="foot-sep" aria-hidden="true">/</span>
|
||||||
|
{{instagram_link}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="foot-brand">{{brand_name}}</p>
|
||||||
|
|
||||||
|
<div class="foot-credits">
|
||||||
|
<p class="credits-title">이미지 출처</p>
|
||||||
|
<ul class="credits">
|
||||||
|
{{#credits}}<li><span>{{title}}</span> — {{author}} / {{license}}</li>{{/credits}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="foot-copy">© {{since}} {{brand_name}}</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
<section class="hero" aria-labelledby="hero-title">
|
||||||
|
<div class="shell hero-grid">
|
||||||
|
<div class="hero-copy">
|
||||||
|
<h1 id="hero-title">천 위에,<br>한 땀씩.</h1>
|
||||||
|
<p class="hero-lede">{{intro}}</p>
|
||||||
|
<div class="hero-actions">
|
||||||
|
<a class="btn" href="#works">작품 보기</a>
|
||||||
|
<a class="text-link" href="#process">제작 과정</a>
|
||||||
|
</div>
|
||||||
|
<p class="hero-meta">자수 티매트 · 린넨 · 손바느질 · {{since}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<figure class="hero-figure">
|
||||||
|
<div class="hero-media">
|
||||||
|
<img src="{{hero_image}}" alt="{{hero_alt}}" width="{{hero_width}}" height="{{hero_height}}" loading="eager" fetchpriority="high" decoding="async">
|
||||||
|
</div>
|
||||||
|
<figcaption>
|
||||||
|
<a href="{{hero_href}}">{{hero_title}}</a>
|
||||||
|
<span>{{hero_material}}</span>
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section works" id="works" aria-labelledby="works-title">
|
||||||
|
<div class="shell">
|
||||||
|
<header class="section-head">
|
||||||
|
<p class="label">WORKS</p>
|
||||||
|
<h2 id="works-title">작품</h2>
|
||||||
|
<p class="section-note">최근에 만든 순서로 놓았습니다. 한 점씩, 천과 실을 고른 뒤에 시작합니다.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="works-grid">
|
||||||
|
{{#products}}
|
||||||
|
<article class="work">
|
||||||
|
<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>
|
||||||
|
{{sold_html}}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</article>
|
||||||
|
{{/products}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section process" id="process" aria-labelledby="process-title">
|
||||||
|
<div class="shell">
|
||||||
|
<header class="section-head">
|
||||||
|
<p class="label">PROCESS</p>
|
||||||
|
<h2 id="process-title">한 점이 되기까지</h2>
|
||||||
|
<p class="section-note">{{process_intro}}</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<ol class="process-list">
|
||||||
|
{{#process}}
|
||||||
|
<li class="{{step_class}}">
|
||||||
|
<p class="step-number" aria-hidden="true">{{step}}</p>
|
||||||
|
<div class="step-copy">
|
||||||
|
<h3>{{title}}</h3>
|
||||||
|
{{body_html}}
|
||||||
|
</div>
|
||||||
|
{{image_html}}
|
||||||
|
</li>
|
||||||
|
{{/process}}
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="kit" id="kit" aria-labelledby="kit-title">
|
||||||
|
<div class="shell kit-grid">
|
||||||
|
<div class="kit-copy">
|
||||||
|
<p class="label label-invert">KIT</p>
|
||||||
|
<h2 id="kit-title">{{kit_title}}</h2>
|
||||||
|
<p class="kit-sub">{{kit_subtitle}}</p>
|
||||||
|
{{kit_excerpt}}
|
||||||
|
<p class="kit-note">{{kit_note}}</p>
|
||||||
|
<p class="kit-price">{{kit_price}}</p>
|
||||||
|
{{kit_action}}
|
||||||
|
<a class="kit-more" href="{{kit_href}}">키트 자세히 보기 →</a>
|
||||||
|
</div>
|
||||||
|
<figure class="kit-figure">
|
||||||
|
<img src="{{kit_image}}" alt="{{kit_alt}}" width="{{kit_width}}" height="{{kit_height}}" loading="lazy" decoding="async">
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section order" id="order" aria-labelledby="order-title">
|
||||||
|
<div class="shell">
|
||||||
|
<header class="section-head">
|
||||||
|
<p class="label">ORDER</p>
|
||||||
|
<h2 id="order-title">주문과 세탁</h2>
|
||||||
|
<p class="section-note">주문 전에 소재와 규격을 한 번 더 확인해 주세요.</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="order-grid">
|
||||||
|
<div class="order-col">
|
||||||
|
<h3>배송</h3>
|
||||||
|
<ul class="info-list">
|
||||||
|
{{#shipping}}<li>{{text}}</li>{{/shipping}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="order-col">
|
||||||
|
<h3>세탁</h3>
|
||||||
|
<ul class="info-list">
|
||||||
|
{{#care}}<li>{{text}}</li>{{/care}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="order-note">{{store_note}}</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="section contact" id="contact" aria-labelledby="contact-title">
|
||||||
|
<div class="shell">
|
||||||
|
<p class="label">CONTACT</p>
|
||||||
|
<h2 id="contact-title">천에 대해 궁금한 것이 있으면<br>편하게 물어보세요.</h2>
|
||||||
|
<a class="contact-email" href="{{email_href}}">{{contact_email}}</a>
|
||||||
|
<p class="contact-sub">작품과 키트에 대한 질문은 메일로 받습니다. {{instagram_link}}</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<div class="shell">
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<div class="product-info">
|
||||||
|
<h1>{{title}}</h1>
|
||||||
|
<p class="product-sub">{{subtitle}}</p>
|
||||||
|
<p class="product-price">{{price_text}}</p>
|
||||||
|
{{sold_html}}
|
||||||
|
{{buy_html}}
|
||||||
|
|
||||||
|
<dl class="spec">
|
||||||
|
<div>
|
||||||
|
<dt>소재</dt>
|
||||||
|
<dd>{{material}}</dd>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<dt>규격</dt>
|
||||||
|
<dd>{{size}}</dd>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<dt>세탁</dt>
|
||||||
|
<dd>{{care}}</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="product-story">
|
||||||
|
<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-next">{{next_html}}</div>
|
||||||
|
</nav>
|
||||||
|
</article>
|
||||||
Reference in new issue
Block a user