Merge branch 'main' into feature/crawler
This commit is contained in:
commit
dd3ad86715
160 files changed
+111240
-202
No files matched your search
@@ -986,9 +986,26 @@ def to_site_payload(place, snapshot: dict, site, version, links) -> dict:
|
||||
],
|
||||
"narrative": narrative,
|
||||
"theme": theme,
|
||||
# ★ 검색 키워드(SiteOntology). 스냅샷에 있을 때만 싣는다 — 옛 스냅샷·SiteOntology 가 꺼진 빌드에는 없고,
|
||||
# 그때 렌더러는 제목·메타를 예전 그대로 굽는다(solution/site/src/seo/meta.ts).
|
||||
**_seo_entry(snapshot.get("seo")),
|
||||
}
|
||||
|
||||
|
||||
def _seo_entry(value) -> dict:
|
||||
"""스냅샷의 seo(services/seo_keywords) → payload 의 `seo`. 없으면 키 자체를 만들지 않는다.
|
||||
|
||||
★ 여기서 다시 거르지 않는다 — 이 가게 자료로 거르는 곳은 seo_keywords 한 곳이다. 모양만 확인한다.
|
||||
★ 빈 seo 를 만들지 않는다. 빈 배열은 '받았는데 비었다' 로 읽힌다(itineraries 와 같은 규칙)."""
|
||||
if not isinstance(value, dict):
|
||||
return {}
|
||||
keywords = [_text(k) for k in value.get("keywords") or [] if _text(k)]
|
||||
title = _text(value.get("titleKeyword"))
|
||||
if not keywords and not title:
|
||||
return {}
|
||||
return {"seo": {"keywords": keywords, **({"titleKeyword": title} if title else {})}}
|
||||
|
||||
|
||||
def _as_float(value):
|
||||
try:
|
||||
return float(value) if value not in (None, "") else None
|
||||
|
||||
Reference in new issue
Block a user