feat(export): site.webmanifest/robots.txt 자동 생성 및 extras 포함 (TDD)
This commit is contained in:
@@ -6,6 +6,24 @@ export function buildExtrasForPage(page: Page): Record<string, Uint8Array> {
|
||||
const extras: Record<string, Uint8Array> = {}
|
||||
const te = new TextEncoder()
|
||||
|
||||
// Always provide a baseline robots.txt
|
||||
const robots = `User-agent: *\nDisallow:`
|
||||
extras['robots.txt'] = te.encode(robots)
|
||||
|
||||
// Provide a minimal site.webmanifest derived from Page
|
||||
try {
|
||||
const name = page.title || 'App'
|
||||
const short = name.length > 12 ? name.slice(0, 12) : name
|
||||
const manifest = {
|
||||
name,
|
||||
short_name: short,
|
||||
start_url: '/',
|
||||
display: 'standalone',
|
||||
theme_color: page.theme?.primaryColor ?? '#000000',
|
||||
}
|
||||
extras['site.webmanifest'] = te.encode(JSON.stringify(manifest))
|
||||
} catch {}
|
||||
|
||||
const hasAction = !!(page.form?.actionUrl && page.form.actionUrl.trim().length > 0)
|
||||
if (!hasAction) {
|
||||
const code = `// Google Apps Script (Code.gs)
|
||||
|
||||
Reference in New Issue
Block a user