Inside
"
+INTERVIEW_SECTION = """
+
+
Interview
Meet The Doctor
문건학 원장 인터뷰와 {clinic} 공식 채널입니다.
+
+ {interview.video &&
}
+ {interview.links.map((l) => (
+
+ {l.cat}
+
+ {l.desc}
+
+
+ ))}
+
+
+
+
+"""
+# VideoLite 캡션은 병원 유튜브 핸들을 고정으로 붙인다. 외부 채널 영상은 channel 로 바꿔 쓴다
+VIDEOLITE_REPLACEMENTS = [
+ ("note?: string; compact?: boolean }", "note?: string; compact?: boolean; channel?: string }"),
+ ("const { id, title, speaker, published, note, compact = false } = Astro.props;",
+ "const { id, title, speaker, published, note, compact = false, channel } = Astro.props;"),
+ ("{handle}{note ?", "{channel ?? handle}{note ?"),
+]
+
+
+def patch_home_interview():
+ interview = json.load(open(os.path.join(HERE, "clinic.json"), encoding="utf-8")).get("interview")
+ if not interview:
+ return 0
+ json.dump(interview, open(os.path.join(SITE, "src/data/interview.json"), "w", encoding="utf-8"), ensure_ascii=False, indent=2)
+ vp = os.path.join(SITE, "src/components/VideoLite.astro")
+ text = open(vp, encoding="utf-8").read()
+ for old, new in VIDEOLITE_REPLACEMENTS:
+ text = text.replace(old, new)
+ open(vp, "w", encoding="utf-8").write(text)
+ ip = os.path.join(SITE, "src/pages/index.astro")
+ text = open(ip, encoding="utf-8").read()
+ if "data/interview.json" in text:
+ return 0
+ if INTERVIEW_ANCHOR not in text:
+ sys.exit("index.astro 에서 Inside 섹션을 찾지 못해 Interview 섹션을 넣지 못함")
+ text = text.replace("import Gallery from '../components/Gallery.astro';",
+ "import Gallery from '../components/Gallery.astro';\nimport interview from '../data/interview.json';", 1)
+ text = text.replace(INTERVIEW_ANCHOR, INTERVIEW_SECTION + INTERVIEW_ANCHOR, 1)
+ open(ip, "w", encoding="utf-8").write(text)
+ return 1
+
+
+# 푸터 채널 아이콘 (haewon 지시 2026-10-19). 유튜브·강남언니 글자 링크는 아이콘 줄로 옮기고 홈페이지 링크만 남긴다
+FOOTER_LINKS_OLD = "{has(surface('youtube').url) && <> ·
{u.foot_youtube}>}{has(surface('gangnamunni').url) && <> ·
{u.foot_gu}>}"
+FOOTER_CHANNELS = """
+ """
+FOOTER_CSS = """
+/* 푸터 채널 아이콘 (patch_site.py 가 넣음) */
+.site-footer .foot-channels { list-style: none; display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.9rem 0 0; padding: 0; }
+.site-footer .foot-channels a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: #fff; transition: transform .2s, box-shadow .2s; }
+.site-footer .foot-channels a:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
+.site-footer .foot-channels img { width: 20px; height: 20px; display: block; }
+"""
+
+
+def patch_footer_channels():
+ channels = json.load(open(os.path.join(HERE, "clinic.json"), encoding="utf-8")).get("footerChannels")
+ if not channels:
+ return 0
+ dst = os.path.join(SITE, "public", "img", "channels")
+ os.makedirs(dst, exist_ok=True)
+ for c in channels:
+ shutil.copyfile(os.path.join(HERE, "channel-icons", c["icon"]), os.path.join(dst, c["icon"]))
+ json.dump(channels, open(os.path.join(SITE, "src/data/footerChannels.json"), "w", encoding="utf-8"), ensure_ascii=False, indent=2)
+ changed = 0
+ cp = os.path.join(SITE, "src/styles/global.css")
+ css = open(cp, encoding="utf-8").read()
+ if ".foot-channels" not in css:
+ open(cp, "w", encoding="utf-8").write(css.rstrip("\n") + "\n" + FOOTER_CSS)
+ changed += 1
+ bp = os.path.join(SITE, "src/layouts/Base.astro")
+ text = open(bp, encoding="utf-8").read()
+ if "data/footerChannels.json" not in text:
+ if FOOTER_LINKS_OLD not in text:
+ sys.exit("Base.astro 에서 푸터 유튜브·강남언니 링크 줄을 찾지 못해 채널 아이콘을 넣지 못함")
+ text = text.replace("import EN from '../data/factSheetEn.json';",
+ "import EN from '../data/factSheetEn.json';\nimport footerChannels from '../data/footerChannels.json';", 1)
+ text = text.replace(FOOTER_LINKS_OLD, FOOTER_CHANNELS, 1)
+ open(bp, "w", encoding="utf-8").write(text)
+ changed += 1
+ return changed
+
+
def remove_excluded_images():
prefixes = json.load(open(os.path.join(HERE, "clinic.json"), encoding="utf-8")).get("excludeImages", [])
removed = []
@@ -170,6 +275,8 @@ if __name__ == "__main__":
n = patch_copy()
n_en = patch_english()
print(f"영문 처리 {n_en}곳")
+ print(f"홈 인터뷰 섹션 {patch_home_interview()}곳")
+ print(f"푸터 채널 아이콘 {patch_footer_channels()}곳")
removed = remove_excluded_images()
set_site_url_and_share_image()
left = leftovers()