Skip to content

AstroEco is Contributing…

Display your GitHub pull requests using astro-loader-github-prs

withastro/starlight

Description

This PR adds support for custom HTML attributes on autogenerated sidebar links using the autogenerate.attrs option.

  • The autogenerate.attrs is used rather than just attrs as attrs is only supported for links and not groups at the moment. This could be confusing to support attrs on autogenerated groups but not on manually defined groups, so autogenerate.attrs is used to clarify that this is only for links in an autogenerated groups.
  • Using attrs on sidebar groups now results in a type error on top of the existing runtime error. I added some type tests to ensure this is the case.
  • Individual pages can override custom attributes using the sidebar.attrs frontmatter field.
withastro/astro

Changes

Closes #13969

This is a "weird" fix. When rendering the server island inside a fragment, the init function (where we calculate content and hostId, the undefined info of the issue) is called after the render function. So put the generation of hostId and islandContent inside a shared function, and saved it inside the class.

Here's the weird part: when calling render, the props are correctly present and evaluated. However, and init is called, the props aren't there anymore. I'm not sure if this is a bug coming from somewhere else, or that's the expected behaviour.

As a workaround, I created two new functions where we save these props inside the class. Doing so fixes the bug and the rest of the tests keep passing. Still, it's weird

Testing

Added two new tests:

  • simple fragment
  • fragment with slots

Docs

N/A


Last fetched:  |  Scheduled refresh: Every Saturday

See Customizing GitHub Activity Pages to configure your own

Inspired by prs.atinux.com