-
-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sitetitle): img component #2256
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hello! Thank you for opening your first PR to Starlight! ✨ Here’s what will happen next:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this @chappelo! I know you marked this as a draft, but I saw you were making good progress, so thought I’d leave some early feedback.
height={logos.dark.height} | ||
width={logos.dark.width} | ||
alt={config.logo.alt} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The <Image>
component loads the image lazily by default, so we should explicitly override that behaviour here given this is high priority content:
alt={config.logo.alt} | |
alt={config.logo.alt} | |
loading="eager" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, thanks.
class="dark:sl-hidden" | ||
src={logos.light} | ||
height={logos.light.height} | ||
width={logos.light.width} | ||
alt={config.logo.alt} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And then same here:
alt={config.logo.alt} | |
alt={config.logo.alt} | |
loading="eager" |
@delucis thanks for the feedback. would be eternally grateful if you could help clarify a couple things regarding the expected outcomes 🙇
Upon running npm build, three images are processed: A 400x400 Hero I should be aiming to remove the unused asset - which should have already been automatically removed ? Furthermore, if we want to reduce the output images down to one, I should further set the Logo's |
That issue is specific to SVGs — for other image formats we definitely still want two different outputs because they’ll be different sizes as you noticed. That said, I don’t know if Astro is smart enough not to duplicate even SVGs, but that would be the test case rather than the |
ahh woops I got carried with .webp/png. Will investigate with SVG! Thank you. |
Good evening, sorry for the wait. I've done some digging, and as you already stated, the Image component changes alone aren't enough - the SVGs are still being duplicated. I've tried playing w/ config and some methods from /assets but to no avail. I assume this should be addressed in core astro build process, not starlight(?). I'd happily do it, if you think that is the appropriate step. note: I'll take this off draft for now. |
Aha, good to know. My guess would be that because Astro hashes the options used with Bit fiddly to work around: either we manually switch to a regular |
Cool thanks, will take another look this weekend! |
Description