Publish per-page Markdown twins at {route}.md instead of {route}/index.md#56
Merged
Conversation
…}/index.md
Co-located Markdown copies now land at the page URL with `.md` appended
(Claude-docs style) — e.g. /getting-started/first-page.md — instead of nesting
them as /getting-started/first-page/index.md. The root home keeps /index.md,
since /.md is not a usable URL.
- LlmsTxtService.BuildCoLocatedMarkdownPath emits {key}.md; the public-URL
builder, internal-link rewriter, and HTML alternate hints all derive from it.
- LlmsArtifactContentService collapses the ExactClaim("/index.md") +
SuffixClaim("/index.md") pair into one SuffixClaim(".md"): it covers the root
and every nested twin, content routes are extensionless so it shadows none,
and the resolver stays authoritative (null -> falls through) for any .md it
did not generate.
- Updated the DocSite/BlogSite <link rel="alternate"> hints, the Cloudflare
Markdown content-negotiation worker, integration tests, and the docs/examples
that describe the convention.
|
🛰️ Docs preview: https://pr-56.pennington-dev.pages.dev Rebuilt on every push to this PR; torn down when it closes. |
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.
What
Per-page LLM Markdown twins now land at
{route}.md(Claude-docs style) instead of{route}/index.md.The page
/getting-started/first-pagenow publishes its Markdown copy at/getting-started/first-page.md— a sibling of thefirst-page/page folder — rather than nesting it inside as/getting-started/first-page/index.md. This conforms to how Claude's docs and the broaderllms.txtecosystem name their Markdown copies.The root home stays at
/index.md(since/.mdisn't a usable URL, and theindex.llms.mdmachine-home already keys on/index.md).Why
{route}/index.mdforced the agent-facing copy into a nested folder.{route}.mdis the convention agents (and Claude Code'sAccept: text/markdownWebFetch) expect, and it keeps the twin next to the page in the output tree.Changes
Core
LlmsTxtService.BuildCoLocatedMarkdownPathemits{key}.md(rootindex.md). This is the single source the public-URL builder, internal-link rewriter, and HTML<link rel="alternate">hints all derive from.LlmsArtifactContentServicecollapses theExactClaim("/index.md")+SuffixClaim("/index.md")pair into oneSuffixClaim(".md")— covers root and every nested twin. Content routes are extensionless so it shadows none, and the resolver stays authoritative (returnsnull→ router falls through) for any.mdit didn't generate.Serving / chrome
Pages.razor+App.razorbody cue, BlogSiteBlog.razoralternate hints.docs/cloudflare/_worker.js—markdownTwin()now maps/x→/x.md,/x/and/x/index.html→/x.md, and/→/index.mdfor productionAccept: text/markdownnegotiation.Tests & docs
LlmsTxtAndSearchEndpointTestsassertions, plus the docs/examples that describe the convention (index.llms.md, themarkdown-for-agentstutorial, thellms-txthow-to, two example sites).Verification
dotnet buildclean.LlmsTxtAndSearchEndpointTests(17) + projection/smoke tests (13) pass.dotnet run -- buildemits 521{route}.mdtwins and exactly oneindex.md(the root). Confirmedtutorials/getting-started/first-page.mdcoexists withfirst-page/, the llms-onlymigrating-via-ai.mdhas no HTML folder, andsidecar_urlpoints at.mdwhilecanonical_urlkeeps the page's trailing-slash URL.Note for reviewers
docs/Pennington.Docs/Content/blog/llms-txt.mdis intentionally not in this PR — itsindex.md→.mdcorrection is entangled with separate in-flight blog-revamp edits in the working tree, and will ride along with that work.