Skip to content

Clarify that named slots are not supported in md/mdx is layout is expressed in frontmatter #9166

@jrencz

Description

@jrencz

📚 Subject area/topic

Layout

📋 Page(s) affected (or suggested, for new content)

📋 Description of content that is out-of-date or incorrect

There are at least those 2 issues

where it was reported as a bug that named slot doesn't work on md(x) page if layout is attached to the page via the frontmatter.

In withastro/roadmap#285 (comment) I found the following quote:

With the new Content Collections feature, Astro is moving away from the magic layout pattern.

If I understand correctly "magic layout pattern" is what I named "layout is expressed in frontmatter"

But: neither of the pages I listed mentions that the named slots are not supported if layout is attached that way, nor does the https://docs.astro.build/en/guides/markdown-content/ mention a workaround for that.

I think it should be documented how to use layouts with named slots for MDX pages (i.e. use layout as component) and that it's impossible to achieve (nor planned - if I got the quoted response right?) for md.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedIssues looking for someone to run with them!improve or update documentationEnhance / update existing documentation (e.g. add example, improve description, update for changes)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions