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

[Content collections] Remove "unsupported file type" warning #9671

Merged
merged 8 commits into from
Jan 17, 2024

Conversation

bholmesdev
Copy link
Contributor

We decided to remove the "unsupported file type" warning from Content Collections during our roadmap discussions. This requirement led to several bugs and special cases overtime, including an "ignore list" for .DS_Store and special handling for image assets.

Now, all files that are not content (.md) or data (.json) are ignored by default. This means underscores are no longer required for these files. You can still use underscores to hide content or data entries from collection queries.

Changes

  • Remove unsupported file type from warning logs and type-generation internals

Testing

  • Update tests that expect unsupported to now expect ignored
  • Remove one-off tests for DS_Store and image assets

Docs

Copy link

changeset-bot bot commented Jan 11, 2024

🦋 Changeset detected

Latest commit: 4b8ab03

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

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 pkg: astro Related to the core `astro` package (scope) label Jan 11, 2024
@Princesseuh Princesseuh added this to the 4.2.0 milestone Jan 12, 2024
@bluwy bluwy added the semver: minor Change triggers a `minor` release label Jan 12, 2024
@ematipico ematipico requested a review from sarah11918 January 12, 2024 14:59
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.

Yay! Makin' people happy, @bholmesdev ! 🥳

Left a couple of thoughts on the changeset, and I'll just remind you of what we say in docs in case you think we should amend anything there:

A collection entry is any piece of content stored inside of your content collection directory. Entries can use content authoring formats including Markdown (.md) and MDX (.mdx using the MDX integration) or as one of two supported data formats: YAML (.yaml) and JSON (.json). We recommend using a consistent naming scheme (lower-case, dashes instead of spaces) for your files to make it easier to find and organize your content, but this is not required. You can also exclude entries from being built by prefixing the filename with an underscore (_).

We make it sound like you can't even add non-content files at all, so no need to "correct" the need for underscore. But, if a lot of people are doing this, we could possibly choose to mention this pattern if you think it makes collections more compelling.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This PR is blocked because it contains a minor changeset. A reviewer will merge this at the next release if approved.

bholmesdev and others added 2 commits January 12, 2024 16:54
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
@bholmesdev
Copy link
Contributor Author

@sarah11918 Thanks for the edits! Yes, I noticed that paragraph scanning our docs. I think we're okay leaving the docs as-is, and letting users discover asset colocation naturally. I expect most who want it will just... try it! And see that it works as expected 😄

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.

Docs happy with changeset! Signing off!

@ematipico ematipico merged commit 8521ff7 into main Jan 17, 2024
13 checks passed
@ematipico ematipico deleted the refactor/remove-cc-underscore-warning branch January 17, 2024 13:12
@astrobot-houston astrobot-houston mentioned this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants