Upgrade to Astro v5 + implement Content Collections API #271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 callingawait 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!