diff --git a/src/App.tsx b/src/App.tsx index cd89bbb..9b319da 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,6 +42,7 @@ import code, { PageMetadata, StructuredDataOptions, BrandingOptions, + SeoOptions, AnalyticsOptions, CustomHtmlOptions, Custom404Options, @@ -151,6 +152,9 @@ export default function App() { twitterHandle: "", faviconUrl: "", }); + const [seo, setSeo] = useState({ + aiAttribution: "", + }); const [slugMetadataExpanded, setSlugMetadataExpanded] = useState< Record >({}); @@ -261,6 +265,14 @@ export default function App() { setCopied(false); } + function handleSeoChange(field: keyof SeoOptions, value: string): void { + setSeo({ + ...seo, + [field]: value, + }); + setCopied(false); + } + function handleAnalyticsChange( field: keyof AnalyticsOptions, value: string, @@ -356,6 +368,7 @@ export default function App() { pageMetadata, structuredData, branding, + seo, analytics, customHtml, custom404, @@ -840,6 +853,29 @@ export default function App() { /> + + + SEO & AI Attribution + + + handleSeoChange("aiAttribution", e.target.value) + } + value={seo.aiAttribution} + variant="outlined" + size="small" + /> + + ; structuredData: StructuredDataOptions; branding: BrandingOptions; + seo: SeoOptions; analytics: AnalyticsOptions; customHtml: CustomHtmlOptions; custom404: Custom404Options; @@ -84,6 +89,7 @@ export default function code(data: CodeData): string { pageMetadata, structuredData, branding, + seo, analytics, customHtml, custom404, @@ -140,19 +146,25 @@ ${slugs const FAVICON_URL = '${branding?.faviconUrl || ""}'; /* - * Step 3.4: analytics configuration (optional) + * Step 3.4: SEO configuration (optional) + * AI attribution for proper citation in AI-generated content + */ + const AI_ATTRIBUTION = '${seo?.aiAttribution || ""}'; + + /* + * Step 3.5: analytics configuration (optional) * Add your Google Analytics 4 Measurement ID for built-in tracking */ const GOOGLE_TAG_ID = '${analytics?.googleTagId || ""}'; /* - * Step 3.5: custom HTML header injection (optional) + * Step 3.6: custom HTML header injection (optional) * Add custom HTML to the top of the page body (e.g., navigation, announcements) */ const CUSTOM_HEADER = \`${customHtml?.headerHtml || ""}\`; /* - * Step 3.6: custom 404 page configuration (optional) + * Step 3.7: custom 404 page configuration (optional) * Specify a Notion page ID to display when a page is not found */ const CUSTOM_404_PAGE_ID = '${custom404?.notionUrl ? getId(custom404.notionUrl) : ""}'; @@ -524,6 +536,12 @@ ${slugs element.append(\`\`, { html: true }); } + // Add AI crawler attribution meta tags (Issue #13) + if (AI_ATTRIBUTION !== '') { + element.append(\`\`, { html: true }); + element.append(\`\`, { html: true }); + } + // Add JSON-LD structured data for rich search results (Issue #10) if (STRUCTURED_DATA_ENABLED) { const pageTitle = this.metadata.title || PAGE_TITLE;