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

Upgrade to Astro v5 + implement Content Collections API #271

Closed
wants to merge 2 commits into from

Conversation

jerhage
Copy link

@jerhage jerhage commented Jan 5, 2025

Hi, all. I first learned about this project this afternoon and decided to have a look. I really like it, so I jumped in to make a few tweaks with the main purpose of upgrading to Astro v5 (see also the related issue here. With this, it was necessary to make tweaks to how content collections are implemented using the Content Collections API.

In addition to tweaks to the content collections implementation, there were 2 issues related to ImageWrapper.astro that caused crashing.
(1) Although there was a check for if file was ever undefined, the code would still try calling await file().
(2) Due to Astro v5 and the deprecation of how content was implicitly handled, the cover image for the guide post located at src/content/posts/guide/index.md was not loading correctly. Namely, ImageWrapper was looking for ../../content/posts/cover.jpeg instead of ../../content/posts/guide/cover.jpeg.

To fix (2), I opted to flatten the file structure since the guide directory was bare and was essentially wrapping a post that was the same type as the posts collection. Another option was to create a separate collection just for guides and make additional updates to load those posts.

Please let me know if you have any questions or concerns. Or, if you're not taking outside contributions, then I apologize for the bother!

Copy link

vercel bot commented Jan 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuwari-yags ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2025 4:28am

@L4Ph
Copy link
Contributor

L4Ph commented Jan 5, 2025

I'm working on it here. There are some issues, so I'd be happy if you could list them as issues.
#232

Also, if possible, I would like to make improvements that can be done without the Content Layer API first, and then create a PR for the Content Layer API (because it would be a breaking change).

What do you think?
CC: @saicaca

@jerhage jerhage closed this Jan 19, 2025
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