From b8438a071235e331768e7a6164ccb57d6f9e0c9f Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 5 Dec 2026 03:39:22 -0600 Subject: [PATCH 1/2] fix(landing): keep the website's noindex at /, open the cookie policy in a new tab, and rebuild docs on catalog changes - readRobotsTag still passes the website's X-Robots-Tag only when every directive is known, but a header with an unknown directive now keeps a noindex (or none, also when scoped to one crawler) as a plain noindex, so / can only end up stricter than the website asked. - The consent banner's Cookie Policy link now leaves for the website, so it opens in a new tab like the settings link, keeping the visitor's place. - compile-content's pipeline inputs are one module list that keys the cache and drives --watch, so edits to the integration FAQ overrides and catalog rebuild, including the deployment-config files outside the docs tree. --- apps/docs/scripts/compile-content.ts | 56 +++++++++++-------- .../sim/app/_shell/consent/consent-banner.tsx | 7 ++- apps/sim/lib/website/homepage.test.ts | 8 ++- apps/sim/lib/website/homepage.ts | 12 +++- 4 files changed, 54 insertions(+), 29 deletions(-) diff --git a/apps/docs/scripts/compile-content.ts b/apps/docs/scripts/compile-content.ts index 3dea43fe2ac..9ae438350ca 100644 --- a/apps/docs/scripts/compile-content.ts +++ b/apps/docs/scripts/compile-content.ts @@ -24,6 +24,26 @@ const SYNTAX_THEME_FILE = path.resolve( DOCS_ROOT, '../../packages/emcn/src/components/code/syntax-theme.ts' ) +/** + * Files whose change can alter every page's output: their content keys the compile cache, and + * `--watch` rebuilds when any of them changes. + */ +const PIPELINE_FILES = [ + import.meta.filename, + path.join(DOCS_ROOT, 'lib/content/compile.ts'), + path.join(DOCS_ROOT, 'lib/content/markdown.ts'), + path.join(DOCS_ROOT, 'lib/content/output.ts'), + path.join(DOCS_ROOT, 'lib/shiki-theme.ts'), + SYNTAX_THEME_FILE, + path.join(DOCS_ROOT, 'components/workflow-preview/examples.ts'), + path.join(DOCS_ROOT, 'components/workflow-preview/block-display-workflows.ts'), + path.join(DOCS_ROOT, 'package.json'), + // Integration pages and their index expand catalog content and FAQs from these. + path.join(DOCS_ROOT, 'lib/integrations/seo.ts'), + path.join(DOCS_ROOT, 'lib/integrations/seo-overrides.ts'), + path.join(DOCS_ROOT, '../../packages/deployment-config/src/integrations.json'), + path.join(DOCS_ROOT, '../../packages/deployment-config/src/integration-totals.ts'), +] const CONTENT_ROOT = path.join(DOCS_ROOT, 'content/docs') const OUTPUT_ROOT = path.join(DOCS_ROOT, '.content') const MAX_CONTENT_BYTES = 64 * 1024 * 1024 @@ -197,24 +217,8 @@ function validateMedia(relative: string, mediaPaths: string[]) { async function generate() { await mkdir(path.join(OUTPUT_ROOT, 'pages'), { recursive: true }) - const pipelineFiles = [ - import.meta.filename, - path.join(DOCS_ROOT, 'lib/content/compile.ts'), - path.join(DOCS_ROOT, 'lib/content/markdown.ts'), - path.join(DOCS_ROOT, 'lib/content/output.ts'), - path.join(DOCS_ROOT, 'lib/shiki-theme.ts'), - SYNTAX_THEME_FILE, - path.join(DOCS_ROOT, 'components/workflow-preview/examples.ts'), - path.join(DOCS_ROOT, 'components/workflow-preview/block-display-workflows.ts'), - path.join(DOCS_ROOT, 'package.json'), - /** Integration pages and their index expand catalog content and FAQs from these. */ - path.join(DOCS_ROOT, 'lib/integrations/seo.ts'), - path.join(DOCS_ROOT, 'lib/integrations/seo-overrides.ts'), - path.join(DOCS_ROOT, '../../packages/deployment-config/src/integrations.json'), - path.join(DOCS_ROOT, '../../packages/deployment-config/src/integration-totals.ts'), - ] const pipelineHash = hash( - (await Promise.all(pipelineFiles.map((file) => readFile(file, 'utf8')))).join('\n') + (await Promise.all(PIPELINE_FILES.map((file) => readFile(file, 'utf8')))).join('\n') ) const previous = await readCache() const cache: CompiledCache = { pipeline: pipelineHash, files: {} } @@ -473,6 +477,8 @@ if (process.argv.includes('--watch')) { void refresh() }, 150) } + const pipelineFiles = new Set(PIPELINE_FILES) + const openApiSpecs = new Set(OPENAPI_SPEC_FILES) watch(DOCS_ROOT, { recursive: true }, (_, filename) => { const changed = filename?.toString().replaceAll('\\', '/') ?? '' if ( @@ -480,15 +486,21 @@ if (process.argv.includes('--watch')) { !changed.startsWith('lib/content/') && !changed.startsWith('lib/search/') && !changed.startsWith('components/workflow-preview/') && - !['scripts/compile-content.ts', 'lib/shiki-theme.ts', ...OPENAPI_SPEC_FILES].includes(changed) + !openApiSpecs.has(changed) && + !pipelineFiles.has(path.join(DOCS_ROOT, changed)) ) return scheduleRefresh() }) - /* Editors save by replacing the file, which ends a watch on the file itself; watch its folder. */ - watch(path.dirname(SYNTAX_THEME_FILE), (_, filename) => { - if (filename?.toString() === path.basename(SYNTAX_THEME_FILE)) scheduleRefresh() - }) + // Pipeline files outside the docs tree: editors save by replacing a file, which ends a watch on + // the file itself, so each one's folder is watched instead. + const outsideDocs = (folder: string) => path.relative(DOCS_ROOT, folder).startsWith('..') + for (const folder of new Set(PIPELINE_FILES.map((file) => path.dirname(file)))) { + if (!outsideDocs(folder)) continue + watch(folder, (_, filename) => { + if (filename && pipelineFiles.has(path.join(folder, filename.toString()))) scheduleRefresh() + }) + } logger.info('Watching documentation source') await refresh() } else await generate() diff --git a/apps/sim/app/_shell/consent/consent-banner.tsx b/apps/sim/app/_shell/consent/consent-banner.tsx index c3e047866a7..03b84f63a92 100644 --- a/apps/sim/app/_shell/consent/consent-banner.tsx +++ b/apps/sim/app/_shell/consent/consent-banner.tsx @@ -74,7 +74,12 @@ export function ConsentBanner() { Necessary cookies keep Sim working. Optional cookies help us understand usage, measure campaigns, and personalize ads on other sites. You can change or withdraw consent at any time in Privacy settings or through our{' '} - + Cookie Policy . diff --git a/apps/sim/lib/website/homepage.test.ts b/apps/sim/lib/website/homepage.test.ts index 0670579439e..e1e3265c181 100644 --- a/apps/sim/lib/website/homepage.test.ts +++ b/apps/sim/lib/website/homepage.test.ts @@ -92,11 +92,13 @@ describe('fetchWebsiteHomepage', () => { ['noindex', 'noindex'], ['noindex, nofollow', 'noindex, nofollow'], ['NoIndex,max-snippet:-1', 'noindex, max-snippet:-1'], - ['noindex, unavailable_after: 2027-01-01', null], - ['googlebot: noindex', null], + ['noindex, unavailable_after: 2027-01-01', 'noindex'], + ['googlebot: noindex', 'noindex'], + ['googlebot: none', 'noindex'], + ['index, unavailable_after: 2027-01-01', null], ['noindex\nSet-Cookie: x=1', null], ])( - 'passes on the website indexing directives only when all are known: %j', + 'passes on the website indexing directives when all are known, and a noindex in any case: %j', async (tag, expected) => { const upstream = await startUpstream((response) => { response.writeHead(200, { diff --git a/apps/sim/lib/website/homepage.ts b/apps/sim/lib/website/homepage.ts index 94fa2228480..f9f0594cb31 100644 --- a/apps/sim/lib/website/homepage.ts +++ b/apps/sim/lib/website/homepage.ts @@ -57,11 +57,11 @@ interface WebsiteHomepage { body: string /** The website's page policy; Markdown is not rendered as a page and carries none. */ contentSecurityPolicy: string | null - /** The website's indexing directives (`X-Robots-Tag`), when they are all known directives. */ + /** The website's indexing directives (`X-Robots-Tag`), when known, or `noindex` when it asked for one. */ robotsTag: string | null } -/** Indexing directives that may be passed on; anything else drops the whole header. */ +/** Indexing directives that may be passed on as written. */ const ROBOTS_DIRECTIVES = new Set([ 'all', 'index', @@ -76,9 +76,14 @@ const ROBOTS_DIRECTIVES = new Set([ ]) const ROBOTS_LIMIT_DIRECTIVE = /^max-(?:snippet|image-preview|video-preview):[a-z0-9-]+$/ +/** A `noindex` or `none`, alone or scoped to one crawler (`googlebot: noindex`). */ +const NOINDEX_DIRECTIVE = /(?:^|[\s:])(?:noindex|none)$/ + /** * The website's `X-Robots-Tag` when every directive in it is a known one, so its indexing choice * (e.g. `noindex` on a non-indexable build) holds at `/` too without passing anything else on. + * A header with an unknown directive is not passed on, but a `noindex` in it still is, as a plain + * `noindex`: `/` can only end up stricter than the website asked, never more indexable. */ function readRobotsTag(value: string | null): string | null { if (!value) return null @@ -86,7 +91,8 @@ function readRobotsTag(value: string | null): string | null { const known = directives.every( (directive) => ROBOTS_DIRECTIVES.has(directive) || ROBOTS_LIMIT_DIRECTIVE.test(directive) ) - return known ? directives.join(', ') : null + if (known) return directives.join(', ') + return directives.some((directive) => NOINDEX_DIRECTIVE.test(directive)) ? 'noindex' : null } /** From 56af21c059441f5c3988edca22dd91caabd8dbea Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sat, 5 Dec 2026 03:51:48 -0600 Subject: [PATCH 2/2] fix(landing): read a max-* limit's none as a limit, not a noindex max-image-preview:none only turns off image previews; the noindex fallback matched its trailing :none and would have kept / out of the index when such a header also carried an unknown directive. A noindex or none now counts alone or after a crawler name, never as a max-* limit's value. --- apps/sim/lib/website/homepage.test.ts | 1 + apps/sim/lib/website/homepage.ts | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/sim/lib/website/homepage.test.ts b/apps/sim/lib/website/homepage.test.ts index e1e3265c181..dcd904682cd 100644 --- a/apps/sim/lib/website/homepage.test.ts +++ b/apps/sim/lib/website/homepage.test.ts @@ -96,6 +96,7 @@ describe('fetchWebsiteHomepage', () => { ['googlebot: noindex', 'noindex'], ['googlebot: none', 'noindex'], ['index, unavailable_after: 2027-01-01', null], + ['max-image-preview:none, unavailable_after: 2027-01-01', null], ['noindex\nSet-Cookie: x=1', null], ])( 'passes on the website indexing directives when all are known, and a noindex in any case: %j', diff --git a/apps/sim/lib/website/homepage.ts b/apps/sim/lib/website/homepage.ts index f9f0594cb31..f715b233008 100644 --- a/apps/sim/lib/website/homepage.ts +++ b/apps/sim/lib/website/homepage.ts @@ -76,8 +76,11 @@ const ROBOTS_DIRECTIVES = new Set([ ]) const ROBOTS_LIMIT_DIRECTIVE = /^max-(?:snippet|image-preview|video-preview):[a-z0-9-]+$/ -/** A `noindex` or `none`, alone or scoped to one crawler (`googlebot: noindex`). */ -const NOINDEX_DIRECTIVE = /(?:^|[\s:])(?:noindex|none)$/ +/** + * A `noindex` or `none`, alone or scoped to one crawler (`googlebot: noindex`); the value of a + * `max-*:` limit (`max-image-preview:none`) is not one. + */ +const NOINDEX_DIRECTIVE = /^(?:(?!max-)[\w-]+:\s*)?(?:noindex|none)$/ /** * The website's `X-Robots-Tag` when every directive in it is a known one, so its indexing choice