Phase7-PerfSEO: robots meta UI 연동(TDD) 및 Preview/Export 반영
This commit is contained in:
@@ -57,6 +57,7 @@ export default function BuilderClientPage() {
|
||||
const [manifestDisplay, setManifestDisplay] = useState<string>('')
|
||||
const [manifestThemeColor, setManifestThemeColor] = useState<string>('')
|
||||
const [robotsDisallow, setRobotsDisallow] = useState<string>('')
|
||||
const [robotsMeta, setRobotsMeta] = useState<string>('')
|
||||
const [sheetsMode, setSheetsMode] = useState<'auto' | 'include' | 'exclude'>('auto')
|
||||
const [assetPathStrategy, setAssetPathStrategy] = useState<'flat' | 'grouped'>('flat')
|
||||
// Font optimization: allow toggling Google Fonts preconnect links in exported HTML
|
||||
@@ -197,7 +198,7 @@ export default function BuilderClientPage() {
|
||||
w.__exportPreview = () => {
|
||||
try {
|
||||
// Export preview with current optimization options
|
||||
return exportPage(pageSchema.parse(pageData), { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding })
|
||||
return exportPage(pageSchema.parse(pageData), { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding, robotsMeta: robotsMeta.trim() || undefined })
|
||||
} catch {
|
||||
const fixed: Page = {
|
||||
...pageData,
|
||||
@@ -207,12 +208,12 @@ export default function BuilderClientPage() {
|
||||
spamProtection: pageData.form?.spamProtection ?? { honeypotFieldName: '_hp', minSubmitSeconds: 2 },
|
||||
},
|
||||
}
|
||||
return exportPage(pageSchema.parse(fixed), { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding })
|
||||
return exportPage(pageSchema.parse(fixed), { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding, robotsMeta: robotsMeta.trim() || undefined })
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}, [pageData, am, fontPreconnect, fontPreload, imageLoading, imageDecoding, assetPathStrategy])
|
||||
}, [pageData, am, fontPreconnect, fontPreload, imageLoading, imageDecoding, robotsMeta, assetPathStrategy])
|
||||
|
||||
const doExport = useCallback(async () => {
|
||||
let valid = pageData as Page
|
||||
@@ -240,8 +241,8 @@ export default function BuilderClientPage() {
|
||||
}
|
||||
return clone
|
||||
}
|
||||
// Respect font and image optimization toggles when exporting
|
||||
const exported = exportPage(valid, { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding })
|
||||
// Respect font, image, robots meta optimization toggles when exporting
|
||||
const exported = exportPage(valid, { assetManager: buildEffectiveAm(), fontPreconnect, fontPreload, imageLoading, imageDecoding, robotsMeta: robotsMeta.trim() || undefined })
|
||||
try {
|
||||
if (typeof window !== 'undefined') {
|
||||
const w = window as unknown as { __captureExport?: boolean; __lastExport?: { html: string; css: string; js: string } }
|
||||
@@ -288,7 +289,7 @@ export default function BuilderClientPage() {
|
||||
}
|
||||
const zipBytes = await buildZip({ html: exported.html, css: exported.css, js: exported.js, assets, extras })
|
||||
download('landing.zip', zipBytes)
|
||||
}, [pageData, am, manifestName, manifestShortName, manifestStartUrl, manifestDisplay, manifestThemeColor, robotsDisallow, sheetsMode, fontPreconnect, fontPreload, imageLoading, imageDecoding, assetPathStrategy])
|
||||
}, [pageData, am, manifestName, manifestShortName, manifestStartUrl, manifestDisplay, manifestThemeColor, robotsDisallow, sheetsMode, fontPreconnect, fontPreload, imageLoading, imageDecoding, robotsMeta, assetPathStrategy])
|
||||
|
||||
return (
|
||||
<div className="p-6 space-y-6">
|
||||
@@ -487,6 +488,17 @@ export default function BuilderClientPage() {
|
||||
placeholder="/private\n/tmp"
|
||||
/>
|
||||
</label>
|
||||
<label className="block" htmlFor="ins-robots-meta">
|
||||
<span className="sr-only">Robots Meta</span>
|
||||
<input
|
||||
id="ins-robots-meta"
|
||||
aria-label="Robots Meta"
|
||||
className="border rounded px-3 py-2 w-full"
|
||||
value={robotsMeta}
|
||||
onChange={(e) => setRobotsMeta(e.target.value)}
|
||||
placeholder="noindex, nofollow"
|
||||
/>
|
||||
</label>
|
||||
<label className="block" htmlFor="ins-sheets-mode">
|
||||
<span className="sr-only">Google Sheets Template Mode</span>
|
||||
<select
|
||||
|
||||
Reference in New Issue
Block a user