Skip to content

Don’t set defaults for attrs and content in head entries#3122

Merged
delucis merged 2 commits intomainfrom
chris/head-schema
Apr 16, 2025
Merged

Don’t set defaults for attrs and content in head entries#3122
delucis merged 2 commits intomainfrom
chris/head-schema

Conversation

@delucis
Copy link
Copy Markdown
Member

@delucis delucis commented Apr 16, 2025

Description

  • Removes default values for attrs and content from the schema used to parse head entries (previously these were {} and "" respectively).
  • This makes it simpler to add new entries directly to the parsed head array without types saying you must set these default values.
  • Made this a minor as it could technically be breaking for users or plugins who are overriding or processing head in some way, although for the average site this should be basically an internal API change.
  • No docs change needed as we already document head by linking to HeadConfig, which shows these properties as optional.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 16, 2025

🦋 Changeset detected

Latest commit: 844f0ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Apr 16, 2025
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 16, 2025

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 844f0ba
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/67ff6cb921d50c00083ac941
😎 Deploy Preview https://deploy-preview-3122--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

@astrobot-houston
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
/index.html 6.93 KB (0%)
/_astro/*.js 25.76 KB (0%)
/_astro/*.css 13.92 KB (0%)

@delucis delucis added the 🌟 minor Change that triggers a minor release label Apr 16, 2025
@delucis delucis added this to the v0.34 milestone Apr 16, 2025
Copy link
Copy Markdown
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, was planning to do this during lunch after noticing it while updating guides on my website for Starlight 0.33 but you already did it 🎉 🙌

Looks perfect to me, easier for users, easier for us in our tests, only wins all around.

I'll just have to update my guides again 😄

@delucis delucis added the ✅ approved Pull requests that have been approved and are ready to merge when next cutting a release label Apr 16, 2025
@delucis delucis merged commit 3a087d8 into main Apr 16, 2025
16 checks passed
@delucis delucis deleted the chris/head-schema branch April 16, 2025 09:27
@astrobot-houston astrobot-houston mentioned this pull request Apr 16, 2025
HiDeoo added a commit to HiDeoo/starlight that referenced this pull request Apr 16, 2025
* main:
  [ci] release (withastro#3124)
  Fix E2E tests broken by formatter
  [ci] format
  Add built-in heading anchor link support (withastro#3033)
  i18n(fr): update `environmental-impact` (withastro#3123)
  Cascade Layers (withastro#2322)
  Fix image metadata validation in StarlightPage schema (withastro#3118)
  Don’t set defaults for `attrs` and `content` in head entries (withastro#3122)
  [ci] format
  i18n(es) Translate `route-data` (withastro#3071)
Yoxnear pushed a commit to Yoxnear/starlight-custom that referenced this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ approved Pull requests that have been approved and are ready to merge when next cutting a release 🌟 core Changes to Starlight’s main package 🌟 minor Change that triggers a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants