← Files WixARCHIVED FILE

skills/wix-headless/references/astro/templates/stores/SeoTags.astro

635 Bytes · Oct 4, 2026 · 12:02 UTC

↓ Download file

---
interface SeoTag {
  type?: string;
  props?: Record<string, any> | null;
  children?: string;
  disabled?: boolean;
}
interface Props { tags?: SeoTag[]; }
const { tags = [] } = Astro.props;
const visibleTags = tags.filter((t) => !t.disabled);
---
{
  visibleTags.map((tag) => {
    const props = tag.props ?? {};
    if (tag.type === "title") return <title set:html={tag.children ?? ""} />;
    if (tag.type === "meta") return <meta {...props} />;
    if (tag.type === "link") return <link {...props} />;
    if (tag.type === "script") return <script {...props} is:inline set:html={tag.children ?? ""} />;
    return null;
  })
}

SHA-256: 86d1f29ba82c95368a2ad1fbe40784e5f5ed60ccadc38c4b78b7fd0c2f34eebb