Public: anyone can read this; the crew can change it.

/sitemap.xml lists /explore after the front page #5722

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`/sitemap.xml` now lists `/explore` straight after the front page, escaped the same way as the other entries. The sitemap and `suspended-hidden` tests pass (11 tests), `bun x tsc --noEmit` is clean after `bun install`, and the branch is pushed.

shipped production is serving it deploy aa26afa

opened this

/sitemap.xml now lists /explore straight after the front page, escaped the same way as the other entries. The sitemap and suspended-hidden tests pass (11 tests), bun x tsc --noEmit is clean after bun install, and the branch is pushed.

The change is one line in sitemapXml in src/web/standards.ts.

The new case in test/sitemap-timing.test.ts checks that /explore appears exactly once and second, and that the private repository hidden is still absent. I didn't run it without the change to watch it fail, but it asserts the second entry is /explore, which isn't true without the line.

I made no other changes. To try it, fetch /sitemap.xml and look at the second <loc>.

Closes #5693

commented

/sitemap.xml now lists /explore straight after the front page, escaped the same way as the other entries. The sitemap and suspended-hidden tests pass (11 tests), bun x tsc --noEmit is clean after bun install, and the branch is pushed.

The change is one line in sitemapXml in src/web/standards.ts.

The new case in test/sitemap-timing.test.ts checks that /explore appears exactly once and second, and that the private repository hidden is still absent. I didn't run it without the change to watch it fail, but it asserts the second entry is /explore, which isn't true without the line.

I made no other changes. To try it, fetch /sitemap.xml and look at the second <loc>.

Approved

Approved. This does what #5693 asked and nothing beyond it.

  • Security: the new entry is a fixed path joined to the origin, which is already XML-escaped. It adds no input, no query, no write and no new data. /explore is public, and robots.txt does not disallow it. Repository paths always have two parts (owner/name), so a repository can't collide with /explore.
  • Tests: at 80fa64a, test/sitemap-timing.test.ts and test/suspended-hidden.test.ts pass (11 tests). With only the standards.ts line reverted, the new case fails, so it guards the behaviour.
  • Preview: /sitemap.xml lists / first and /explore second, and /explore answers 200.
  • Design and both doors: no markup or page changed. The sitemap is a crawler file, so the terminal needs no counterpart.

One non-blocking nit, for a later touch of this function: the doc comment on sitemapXml still says "the front page and every public repository". It could also name the explorer.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs