diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cd6c7639f1d3..c243997baa3e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,6 +127,7 @@ Front matter is defined as a YAML block at the top of a Markdown document that d - `feature_image`: Blog posts only. Relative path to a high-resolution hero image (1884×1256) displayed at the top of the blog post page. - `meta_title`: If specified, the meta title (for OpenGraph) will use this value instead of the value in the `title` attribute. - `redirect_to`: The relative or absolute URL of a permanent redirect. +- `sitemap_exclude`: Set to `true` to omit the page from the generated `sitemap.xml` without affecting crawling or indexing (unlike `block_external_search_index`, which also adds a `noindex` directive). Use this only for pages whose canonical URL is already declared, with an accurate `lastmod`, in a different sitemap that Google is submitted (for example a page that is a build-time placeholder for a URL actually served and indexed from a different origin). - `title`: Required (unless `redirect_to` is set), 60 characters or less. This controls the default value for the `` tag as well at the top level `<h1>` in the document. - `title_tag`: If specified, the `<title>` tag on the rendered call will use this value instead of the `title` attribute. diff --git a/content/registry.md b/content/registry.md index a6ff7f459bc1..e2bc3185c082 100644 --- a/content/registry.md +++ b/content/registry.md @@ -1,5 +1,15 @@ --- title: "Pulumi Registry" +# This file is a build-time placeholder only (see the readme note below); the +# CloudFront/S3 trick means Google never actually sees the HTML Hugo renders +# from it. The real https://www.pulumi.com/registry/ page is served by, and +# already listed with an accurate lastmod in the sitemap of, the Registry app +# (github.com/pulumi/registry). Without sitemap_exclude, this placeholder's own +# git-derived lastmod (frozen since the 2023-12-11 commit that introduced it) +# competes with the Registry sitemap's entry for the same canonical URL, and +# consistently wins the "oldest URL in the whole sitemap" contest. Do not +# remove sitemap_exclude without also removing the duplicate from one side. +sitemap_exclude: true readme: | This page is intentionally left blank, which may seem strange, but is actually necessary because of how the CloudFront CDN is configured to serve https://www.pulumi.com/registry/. diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 9e01e7995d29..84fa6689b4e8 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -1,7 +1,7 @@ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> {{ range .Data.Pages }} - {{ if not (or .Params.private .Params.block_external_search_index .Params.redirect_to .Params.redirect_url (not (partial "taxonomy-indexable.html" .))) }} + {{ if not (or .Params.private .Params.block_external_search_index .Params.redirect_to .Params.redirect_url .Params.sitemap_exclude (not (partial "taxonomy-indexable.html" .))) }} {{ $lastmod := .Lastmod }} {{ if in (slice "home" "section" "taxonomy" "term") .Kind }} {{ range .RegularPagesRecursive }}