diff --git a/.github/workflows/argos.yml b/.github/workflows/argos.yml index 06b142dfbbcd..a1111122f5e7 100644 --- a/.github/workflows/argos.yml +++ b/.github/workflows/argos.yml @@ -41,7 +41,7 @@ jobs: run: npx playwright install --with-deps chromium - name: Build website fast - run: yarn build:website:fast --dev + run: yarn build:website:fast:argos --dev - name: Take Argos screenshots run: yarn argos:screenshot diff --git a/argos/tests/screenshot.spec.ts b/argos/tests/screenshot.spec.ts index a3a816f6f835..424e06ef3375 100644 --- a/argos/tests/screenshot.spec.ts +++ b/argos/tests/screenshot.spec.ts @@ -52,6 +52,11 @@ function isBlacklisted(pathname: string) { pathname.startsWith('/changelog') || // versioned docs pathname.match(/^\/docs\/((\d\.\d\.\d)|(next))\//) || + // verbose useless dogfooding pages + pathname.startsWith('/tests/docs/toc/') || + pathname.startsWith('/tests/docs/tags/') || + pathname.startsWith('/tests/blog/page/') || + pathname.startsWith('/tests/blog/tags/') || // manually excluded urls BlacklistedPathnames.includes(pathname) ); diff --git a/package.json b/package.json index 8876ca0adeeb..4ed45339ee69 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "build:website:deployPreview:build": "cross-env NETLIFY=true CONTEXT='deploy-preview' yarn workspace website build", "build:website:deployPreview": "yarn build:website:deployPreview:testWrap && yarn build:website:deployPreview:build", "build:website:fast": "yarn workspace website build:fast", + "build:website:fast:argos": "cross-env DOCUSAURUS_ARGOS_BUILD=true yarn workspace website build:fast", "build:website:fast:rsdoctor": "yarn workspace website build:fast:rsdoctor", "build:website:fast:profile": "yarn workspace website build:fast:profile", "build:website:en": "yarn workspace website build --locale en", diff --git a/website/_dogfooding/dogfooding.config.ts b/website/_dogfooding/dogfooding.config.ts index 94b142cae275..192cb4a8c20b 100644 --- a/website/_dogfooding/dogfooding.config.ts +++ b/website/_dogfooding/dogfooding.config.ts @@ -12,6 +12,14 @@ import type {Options as DocsOptions} from '@docusaurus/plugin-content-docs'; import type {Options as BlogOptions} from '@docusaurus/plugin-content-blog'; import type {Options as PageOptions} from '@docusaurus/plugin-content-pages'; +export const isArgosBuild = process.env.DOCUSAURUS_ARGOS_BUILD === 'true'; + +if (isArgosBuild) { + console.warn( + 'Building site for Argos CI - additional dogfooding pages will be preserved in sitemap', + ); +} + export function dogfoodingTransformFrontMatter(frontMatter: { [key: string]: unknown; }): {[key: string]: unknown} { @@ -39,7 +47,7 @@ export const dogfoodingPluginInstances: PluginConfig[] = [ sidebarPath: '_dogfooding/docs-tests-sidebars.js', versions: { current: { - noIndex: true, + noIndex: !isArgosBuild, }, }, onInlineTags: 'warn', diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 7ae2a4c9b7a2..b52e5c859a7a 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -17,6 +17,7 @@ import { dogfoodingThemeInstances, dogfoodingRedirects, dogfoodingTransformFrontMatter, + isArgosBuild, } from './_dogfooding/dogfooding.config'; import ConfigLocalized from './docusaurus.config.localized.json'; @@ -538,8 +539,10 @@ export default async function createConfigAsync() { } : undefined, sitemap: { - // Note: /tests/docs already has noIndex: true - ignorePatterns: ['/tests/{blog,pages}/**'], + ignorePatterns: isArgosBuild + ? undefined + : // Note: /tests/docs already has noIndex: true + ['/tests/{blog,pages}/**'], lastmod: 'date', priority: null, changefreq: null,