Skip to content

Conversation

@ArmandPhilippot
Copy link
Member

Description (required)

Updates the astro:middleware docs to:

Things to consider:

  • Is it okay to documented astro/middleware in the same place given the page is named astro:middleware? If so, maybe we should add a sentence to explain when to use one over the other.
  • We already document defineMiddleware() and sequence() in astro:middleware imports but the same functions are available from astro/middleware: should they be available from only one version? how to document both without repeating the same thing.

See also withastro/astro#8101 (review) for extra context.

Related issues & labels (optional)

  • Suggested label: add new content, improve or update documentation

@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 895f05e
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6926f81c1edc600008b8f049
😎 Deploy Preview https://deploy-preview-12792--astro-docs-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.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Nov 25, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/middleware.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-middleware.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@sarah11918
Copy link
Member

After some discussion:

astro/middleware in the same place given the page is named astro:middleware?

Yes, let's do this every time there's a regular module associated with the virtual model. Maybe we can have a sentence like "The following are imported from the virtual content module" / "The following are imported from the regular content module" to introduce each code block of imports.

We checked, and there should be a corresponding virtual model for every one of these modules that isn't already covered by its own special API page (e.g. astro/loaders is covered in the Content Loader API page), so keeping these pages named for the virtual modules seems fine.

should they be available from only one version? how to document both without repeating the same thing.

"Should" is something to take up with the framework team! If we're responsible for documenting what is currently, and if both entries would be identical, then it's OK I think to:

  • show them in both import code blocks

  • put the reference entry in the module that we expect more people are using (I suspect the virtual one?)

  • make a section heading in the other module, too, but its only text is to link back to the one written in the other module, maybe like:

     See [`defineMiddleware()`](#definemiddleware) from `astro:middleware`
    

@ArmandPhilippot ArmandPhilippot added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. labels Nov 26, 2025
@ArmandPhilippot ArmandPhilippot marked this pull request as ready for review November 26, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants