Compare commits

...
7 Commits
Author SHA1 Message Date
koreafood ecc8ab4474 deploy: umbrel 라이브 dist 직접 서빙으로 전환 — QNAP rsync 제거(2026-11-27) 2026-11-26 18:55:11 +00:00
koreafood beaaf6555c update 2026-11-20 21:47:28 +09:00
koreafood 72e1926d87 카톡 채널 연결 버그 수정·canonical 추가·모바일 내비 터치 영역 확대
- templates/index.html: 인라인 스크립트 문자열에 실제 개행이 들어가 문법 오류 → 카톡 문의 버튼이 동작하지 않던 문제 (배열 join으로 교체)
- content/site.json: 카톡 채널 주소 추가
- templates/base.html: canonical 태그, 헤더 앵커를 같은 페이지에서는 #앵커로 (불필요한 재로딩 제거)
- assets/css/site.css: 모바일 내비 터치 영역 45px (음수 마진으로 글자 위치 유지)
2026-11-01 18:59:49 +09:00
한땀 작업실 7aaa488825 작품 삭제: 솔잎 티매트 2026-11-01 08:12:19 +00:00
한땀 작업실 ddae2c776a 이력 행: 되돌리기 버튼 줄바꿈 방지 2026-11-01 08:09:35 +00:00
한땀 작업실 e1ddbff1f5 되돌리기 화면: 폰 목록 맨 아래 최근 이력 → 그 커밋 revert(초안 있으면 배포만 건너뜀) 2026-11-01 08:08:08 +00:00
한땀 작업실 3d5a015400 작품 삭제 기능: 수정 화면 DELETE — md·사진·페이지 제거, 되돌리기로 복구, 키트/마지막 작품 보호 2026-11-01 07:59:57 +00:00
13 changed files with 249 additions and 48 deletions

No files matched your search

+8
View File
@@ -91,6 +91,14 @@ bash scripts/studio.sh # http://localhost:8081
- **고치기**: 목록 카드 오른쪽 `수정` → 제목·부제·본문·규격·소재·세탁·가격·날짜·네이버 링크·대표작/품절을 그대로 불러온다.
사진은 순서 바꾸기(첫 장이 대표)·삭제·추가(촬영/앨범)가 되고, 저장하면 `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/` 에 잠시 쌓였다가 발행 시 두 곳으로 나뉜다.
+9 -2
View File
@@ -1188,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;
}
@@ -1283,7 +1290,7 @@ strong {
}
.nav {
gap: 14px;
gap: 0;
}
.wordmark-ko {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

+2
View File
@@ -470,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),
@@ -589,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"]),
-23
View File
@@ -1,23 +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: ""
---
성긴 린넨의 올 사이로 빛이 지나갑니다. 그 위에 녹색 면사를 길게 앉혀 솔잎을 수놓았습니다. 잎마다 방향을 조금씩 달리하여, 같은 잎이 두 번 되풀이되지 않게 하였습니다.
가장자리는 접어 박음질하고, 귀퉁이마다 실을 두 번 돌려 마무리하였습니다. 티포트를 올리면 잎이 향한 쪽을 따라 그림자가 내려앉습니다.
실의 색은 세 가지를 나란히 놓고 골랐습니다. 한 점에 보름 남짓 걸렸습니다. 쓰고 난 뒤에는 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
잎을 따라 손을 옮기던 순서가 천 위에 그대로 남아 있습니다.
@@ -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: ""
---
아이보리 린넨 한 폭을 넓게 펴고, 목련 한 가지를 놓았습니다. 꽃잎은 흰 실로, 가지는 회갈색 실로. 천과 실의 색이 가까워서 가까이에서야 무늬가 보입니다.
꽃잎마다 실의 방향을 바꿔 빛이 드는 쪽을 남겼습니다. 창가에 놓으면 오후에 무늬가 한 번 더 드러납니다.
가장자리는 손으로 접어 박음질하고 귀퉁이를 두 번 돌려 마무리했습니다. 완성까지 열흘 남짓 걸렸습니다. 쓰고 나면 미지근한 물에 단독으로 손세탁하고 그늘에 뉘어 말립니다.
+1 -1
View File
@@ -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",
+8 -10
View File
@@ -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})"
+86
View File
@@ -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%);
@@ -97,6 +100,8 @@
.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>
@@ -122,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>
<!-- ② 사진 -->
@@ -278,6 +289,12 @@
<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>
@@ -727,8 +744,77 @@ $('#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>
+102
View File
@@ -434,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:
@@ -867,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()))
+5 -4
View File
@@ -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&amp;family=Noto+Serif+KR:wght@400;600&amp;display=swap" rel="stylesheet">
<link rel="canonical" href="{{canonical}}">
<link rel="stylesheet" href="{{asset_prefix}}assets/css/site.css">
<link rel="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>
+7 -8
View File
@@ -84,14 +84,13 @@
(function () {
var KAKAO = "{{kakao_url}}";
var TEMPLATE = function (title) {
return title + " 재제작 문의드립니다.
"
+ "- 원하는 시기:
"
+ "- 크기·색상:
"
+ "- 문의 내용: ";
return [
title + " 재제작 문의드립니다.",
"",
"- 원하는 시기: ",
"- 크기·색상: ",
"- 문의 내용: "
].join("\n");
};
document.querySelectorAll("[data-inquiry]").forEach(function (btn) {
btn.addEventListener("click", function () {