Skip to content

docs: Add expose-markdown-docusaurus-plugin resource#11623

Merged
slorber merged 1 commit intofacebook:mainfrom
FlyNumber:patch-1
Dec 22, 2025
Merged

docs: Add expose-markdown-docusaurus-plugin resource#11623
slorber merged 1 commit intofacebook:mainfrom
FlyNumber:patch-1

Conversation

@FlyNumber
Copy link
Copy Markdown
Contributor

@FlyNumber FlyNumber commented Dec 20, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Dec 20, 2025

Hi @FlyNumber!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@netlify
Copy link
Copy Markdown

netlify bot commented Dec 20, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 31626a8
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6945ee3bd5391b0008bc74b4
😎 Deploy Preview https://deploy-preview-11623--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Dec 20, 2025
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Dec 20, 2025

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@slorber
Copy link
Copy Markdown
Collaborator

slorber commented Dec 22, 2025

Thanks

I'm not sure the implementation will handle many edge cases.

An alternative you can try is to use the source file path metadata that our content plugins associate with each route:

          async postBuild({routes}) {
            await Promise.all(
              routes.map(async (route) => {
                console.log(route.metadata?.sourceFilePath)
              }),
            );
          },

@slorber slorber changed the title Add expose-markdown-docusaurus-plugin resource docs: Add expose-markdown-docusaurus-plugin resource Dec 22, 2025
@slorber slorber added the pr: documentation This PR works on the website or other text documents in the repo. label Dec 22, 2025
@slorber slorber merged commit 75a529b into facebook:main Dec 22, 2025
4 checks passed
@FlyNumber
Copy link
Copy Markdown
Contributor Author

Thanks for pointing us to route.metadata.sourceFilePath — that was exactly what we needed. We refactored the plugin to pull source paths directly from the postBuild routes prop instead of scanning the filesystem, which also means it now respects custom routeBasePath configs without any hardcoded assumptions.

@slorber
Copy link
Copy Markdown
Collaborator

slorber commented Mar 20, 2026

Hey, FYI I'll likely add a similar plugin to Docusaurus core because we want to provide such a feature to our users and also deploy something similar on our own website.

I'll likely post here when I start working on this later.


In case it's helpful, here are some references I gathered for myself:

Create llms plugin for the Docusaurus website
https://bsky.app/profile/lekoarts.de/post/3mey2ed7luk26

https://rspress.rs/blog/rspress-v2#llms-txt-ssg-md

https://github.com/okineadev/vitepress-plugin-llms

https://www.lekoarts.de/how-to-add-llms-txt-to-docusaurus/

Markdown sitemap
https://vercel.com/blog/sitemap.md
https://vercel.com/blog/making-agent-friendly-pages-with-content-negotiation
https://vercel.com/blog/making-agent-friendly-pages-with-content-negotiation.md


https://cra.mr/optimizing-content-for-agents
curl -H "Accept: text/markdown" https://thisweekinreact.com/social/README
curl -H "Accept: text/markdown" https://thisweekinreact.com/social/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants