diff --git a/website/scripts/sandboxes.js b/website/scripts/sandboxes.js index 6797a6267..ca5a8cbad 100644 --- a/website/scripts/sandboxes.js +++ b/website/scripts/sandboxes.js @@ -1,7 +1,9 @@ import { cp, glob, - rm + readFile, + rm, + writeFile } from 'node:fs/promises' import { join, @@ -12,6 +14,20 @@ import { const sandboxesRoot = new URL('../../sandboxes/', import.meta.url).pathname const targetRoot = new URL('../public/sandboxes/', import.meta.url).pathname +// A sandbox alone is a chart without text, so search engines should index the example that embeds it. +// Only the copy changes: StackBlitz opens the sandbox from the repository as it is +async function hideFromSearch(page, sandbox) { + const html = await readFile(page, 'utf8') + + if (!html.includes('')) { + throw new Error(`No in ${page}`) + } + + const title = html.includes('