mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
improvement(integrations): overhaul landing FAQs for SEO/GEO and fix dynamic OG images (#4985)
* improvement(integrations): overhaul landing FAQs for SEO/GEO and fix dynamic OG images * improvement(integrations): trim comments and fold catalog updatedAt into integrations.json * fix(integrations): correct FAQ copy for zero-capability and single-tool integrations
This commit is contained in:
@@ -851,14 +851,27 @@ async function writeIntegrationsJson(iconMapping: Record<string, string>): Promi
|
||||
// JSON formatter inlines short arrays of primitive strings. Pre-collapse those
|
||||
// arrays here so the emitted file is already in Biome's canonical shape and
|
||||
// `bun run check` does not churn it on every commit.
|
||||
const json = JSON.stringify(integrations, null, 2).replace(
|
||||
/\[\n(\s+"[^"\n]*"(?:,\n\s+"[^"\n]*")*)\n\s+\]/g,
|
||||
(_match, inner) => {
|
||||
const items = (inner as string).split(',\n').map((s: string) => s.trim())
|
||||
return `[${items.join(', ')}]`
|
||||
}
|
||||
)
|
||||
fs.writeFileSync(jsonPath, `${json}\n`)
|
||||
const serialize = (value: unknown) =>
|
||||
JSON.stringify(value, null, 2).replace(
|
||||
/\[\n(\s+"[^"\n]*"(?:,\n\s+"[^"\n]*")*)\n\s+\]/g,
|
||||
(_match, inner) => {
|
||||
const items = (inner as string).split(',\n').map((s: string) => s.trim())
|
||||
return `[${items.join(', ')}]`
|
||||
}
|
||||
)
|
||||
|
||||
// `updatedAt` is re-stamped only when the integrations content actually
|
||||
// changes, so sitemap/JSON-LD freshness never churns on no-op regens.
|
||||
const previous = fs.existsSync(jsonPath)
|
||||
? (JSON.parse(fs.readFileSync(jsonPath, 'utf-8')) as { integrations?: unknown })
|
||||
: null
|
||||
if (previous?.integrations && serialize(previous.integrations) === serialize(integrations)) {
|
||||
console.log(`✓ Integration data unchanged: ${integrations.length} integrations → ${jsonPath}`)
|
||||
return
|
||||
}
|
||||
|
||||
const updatedAt = new Date().toISOString().slice(0, 10)
|
||||
fs.writeFileSync(jsonPath, `${serialize({ updatedAt, integrations })}\n`)
|
||||
console.log(`✓ Integration data written: ${integrations.length} integrations → ${jsonPath}`)
|
||||
} catch (error) {
|
||||
// Surface taxonomy violations (missing/invalid `integrationType`) loudly —
|
||||
|
||||
Reference in New Issue
Block a user