Skip to content
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

Modernize showcase collection #1248

Merged
merged 7 commits into from
Sep 10, 2024
Merged

Modernize showcase collection #1248

merged 7 commits into from
Sep 10, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Sep 10, 2024

This PR migrates our showcase collection to use more recent Astro features to simplify maintenance.

  • Entries are now YAML data files instead of Markdown pretending to be data files
  • Images are now resolved using the image() helper instead of a custom resolve function
  • Images are now optimized with astro:assets — previously we committed two different resolutions to the repo and chose dynamically between them, now we just toggle the required width in <Image>
  • Images are now directly colocated alongside the data files. Previously we have a src/content/showcase/_images/ directory for these. Now each site’s image file should appear alongside its data file in the file browser, e.g.
    VS Code file tree showing the showcase directory and matching filenames in both WebP and YAML formats
    There still lots and lots of files — not so much I can do about that. (I decided against a single large showcase.json data file thinking it would make finding a specific entry or seeing new entries in Git a little more clumsy.)
  • I’ve updated our update:showcase package script to match this new setup
  • In the process I also replaced the json-to-pretty-yaml dependency with the battle-tested yaml one. yaml is already used by other dependencies, so although json-to-pretty-yaml is laudibly minimal and lightweight, its more limited features weren’t worth working around.

Browser Test Checklist

I have tested this PR on at least three of the following browsers:

  • Chrome / Chromium
  • Firefox
  • Android Firefox
  • Safari
  • iOS Safari

Copy link

netlify bot commented Sep 10, 2024

Deploy Preview for astro-www-2 ready!

Name Link
🔨 Latest commit 608a7ea
🔍 Latest deploy log https://app.netlify.com/sites/astro-www-2/deploys/66e02bcb0bb0f80008de698a
😎 Deploy Preview https://deploy-preview-1248--astro-www-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
5 paths audited
Performance: 98 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 95 (🟢 up 1 from production)
SEO: 93 (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.

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

I browsed both a few pages from the showcase, and a blog post using the showcase entries and all looks good!

@delucis delucis merged commit 54ce60d into main Sep 10, 2024
6 checks passed
@delucis delucis deleted the chris/data-collections branch September 10, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants