Repository navigation
Conversation
bosconi
force-pushed
the
jc/docs-markdown-page-url
branch
from
October 16, 2026 23:57
5e2a1f0 to
b09e99d
Compare
Each docs page's Markdown is now also published at /docs/<path>/index.md, next to its index.html, and llms.txt links that form. An agent can then get any page's Markdown from its URL, and map an llms.txt link back to its page by dropping "index.md". publish-markdown-at-page-urls.sh copies the Markdown pass's output into the HTML tree before hugo deploy, which deletes any object that has no file in public/. Alias directories get a copy of their target's Markdown. /docs/markdown-docs/ stays as it is, and the Markdown's own links still point there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bosconi
force-pushed
the
jc/docs-markdown-page-url
branch
from
October 19, 2026 06:05
b09e99d to
424e574
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a draft because it must not merge until WEB-13 decides whether the docs' Markdown copies should be findable through search, and the matching search-indexing change is live.
EDU-101 item 11: serve each docs page's Markdown at its page URL,
/docs/<path>/index.md, next to itsindex.html, and link that form fromllms.txt.Stacked on #39913; retarget to main after it merges.
Part of: EDU-101
Note
Drafted by a coding agent, in case it's useful.
website.shand the docs deploy are @nisarhassan12's area: take it over, change it, or close it, whichever you prefer.Motivation
Today a page's Markdown is only at
/docs/markdown-docs/<path>/index.md, so a coding agent that has a page URL cannot get its Markdown from it, and/docs/sql/select/index.mdreturns 404. The afdocs measurements in #39470 found thatmarkdown-url-supportfails until this lands, and thatllms-txt-coveragefails untilllms.txtlinks the page-URL form, because afdocs cannot mapmarkdown-docs/links back to pages.What changed
ci/deploy_website/publish-markdown-at-page-urls.shcopies eachmarkdown-docs/<path>/index.mdof a built site to<path>/index.md.website.shandpreview-docs.shrun it after both Hugo passes and beforehugo deploy, so the copies are inpublic/andhugo deployuploads them instead of deleting them.lint-docs.shruns it too, so a docs PR fails if a copy would overwrite a built file.llms.txtlink<baseURL>/<path>/index.md, through a newatPageargument of themarkdown-urlpartial. The note in each section index now says to drop the trailingindex.mdfor the HTML page./docs/markdown-docs/is unchanged, since agents and themz-docsskill read it today. Links inside the Markdown, the HTMLrel="alternate"link and the hidden agent pointer still point there.Decisions
skillformat in the HTML pass would need the Markdown templates to work in a second context, and could drift frommarkdown-docs/. The copy guarantees the two URLs serve identical bytes.website.shturns each alias'sindex.htmlinto a 301. Doing the same forindex.mdwould double the loop'saws s3 cpcalls on every deploy, from 542 to 1,084, so<alias>/index.mdserves the target's Markdown with a 200.www-temporaryscoped the/docs/markdown-docs/Disallowinrobots.txtto Googlebot only, on purpose: Google stops spending crawl budget on duplicates, while other engines keep the Markdown crawlable so coding agents can still find it through search (robots.ts). That followed the discussion on docs: add nofollow to View as Markdown links. #38411, where @maheshwarip noted that agents landing on the Markdown from a web search is useful, and @nisarhassan12 agreed. The new/docs/<path>/index.mdcopies fall outside the Googlebot rule, so Google could crawl them as duplicates of the HTML pages. Two ways to handle that: extend the Googlebot rule inrobots.tsto cover them (Google supports wildcards, for exampleDisallow: /docs/*.md$), which keeps the August policy; or theX-Robots-Tag: noindexheader drafted in MaterializeInc/i2#4261, which would also hide the copies from other engines. This PR should land only after that is decided and in place.Verification
Built the production (
--baseURL /docs), preview andlint-docs.shsites with Hugo 0.152.2, ran the copy script on each, and compared them with builds of #39913:<path>/index.mdis byte-identical tomarkdown-docs/<path>/index.md.index.mdidentical to their target's Markdown, with none skipped. This includes the lint build, where alias targets are full URLs.llms.txtfiles (root and section indexes) resolve to a built file: 564 page Markdown copies and 14 section indexes. None use themarkdown-docs/form.llms.txtfiles and the 1,111 newindex.mdfiles. Themarkdown-docs/trees, the HTML, the skill bundle and the self-managed build are byte-identical.check-docs-markdown.py --fail-on-linkspasses on the production and preview Markdown, andtest_check_docs_markdown.pypasses. A second run of the script on the same tree fails because a copy already exists, which is how a collision with a built file would show up.Full verification needs a deploy, because only the live site shows what S3 and CloudFront serve. After the deploy:
curl -sI https://materialize.com/docs/sql/select/index.mdreturns 200 withcontent-type: text/markdown, and its body matcheshttps://materialize.com/docs/markdown-docs/sql/select/index.md.https://materialize.com/docs/releases/v0.29.0/index.md, returns 200 with the Markdown of/docs/releases/v0.29/.https://materialize.com/docs/markdown-docs/sql/select/index.mdstill returns 200.https://materialize.com/docs/llms.txtand the section indexes it lists returns 200.🤖 Generated with Claude Code