--- import { landingKo, landingEn } from "../i18n/landing"; import socialPreviewKo from "../assets/og-designpaca-ko.png"; import socialPreviewEn from "../assets/og-designpaca-en.png"; import "../styles/fonts.css"; import "../styles/tokens.css"; import "../styles/base.css"; interface Props { lang: "ko" | "en"; title: string; description: string; translationPath?: string | null; noindex?: boolean; } const { lang, title, description, noindex = false } = Astro.props; const copy = lang === "ko" ? landingKo : landingEn; const socialPreview = lang === "ko" ? socialPreviewKo : socialPreviewEn; const socialPreviewAlt = lang === "ko" ? "designpaca의 일곱 단계 디자인 파이프라인 그래픽" : "The seven-stage designpaca pipeline graphic"; const path = Astro.url.pathname; const normalizedPath = path.replace(/\/+$/, "") || "/"; const isKoHome = normalizedPath === "/"; const isEnHome = normalizedPath === "/en"; const inferredTranslationPath = isKoHome ? "/en/" : isEnHome ? "/" : null; const translationPath = Object.prototype.hasOwnProperty.call(Astro.props, "translationPath") ? Astro.props.translationPath : inferredTranslationPath; const homePath = lang === "ko" ? "/" : "/en/"; const showcasePath = lang === "ko" ? "/showcase/" : "/en/showcase/"; const isHome = isKoHome || isEnHome; const navItems = copy.nav.items.map((item) => ({ ...item, href: isHome ? item.href : `${homePath}${item.href}`, })); const repositoryUrl = "https://git.chanpaca.net/yunchan/designpaca"; const canonical = new URL(path, Astro.site); const translated = translationPath ? new URL(translationPath, Astro.site) : null; const socialPreviewUrl = new URL(socialPreview.src, Astro.site); const markBg = "%23c43f20"; const markFg = "%23faf9f4"; const favicon = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='3' fill='${markBg}'/%3E%3Cpath d='M8 6v20M8 7h12M8 11h8M8 15h13M8 19h9M8 23h12' stroke='${markFg}' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E`; const schema = isHome ? { "@context": "https://schema.org", "@type": "WebSite", name: "designpaca", url: new URL("/", Astro.site).href, description, inLanguage: ["ko-KR", "en-US"], } : { "@context": "https://schema.org", "@type": "WebPage", name: title, url: canonical.href, description, inLanguage: lang === "ko" ? "ko-KR" : "en-US", }; ---