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 Loader API: include docs for the built-in loaders #10710

Merged

Conversation

ArmandPhilippot
Copy link
Member

@ArmandPhilippot ArmandPhilippot commented Jan 15, 2025

Description (required)

Updates the Content Loader API page to include a new section for the built-in loaders (glob and file):

  • provide information for the different properties including generateId which was missing in the docs,
  • include examples with different use-cases for each loader
  • add links from the Content Collection guide to the new reference entries
  • add YAML support on both pages for the glob loader

Related issues & labels (optional)

Copy link

netlify bot commented Jan 15, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3e79da6
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/678eb8f380481d00082436be
😎 Deploy Preview https://deploy-preview-10710--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ArmandPhilippot ArmandPhilippot marked this pull request as draft January 15, 2025 14:19
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jan 15, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/content-collections.mdx Source changed, localizations will be marked as outdated.
en/reference/content-loader-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/modules/astro-content.mdx Source changed, localizations will be marked as outdated.
zh-cn/reference/modules/astro-content.mdx Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@ArmandPhilippot ArmandPhilippot changed the title feat(content-loader): update the reference to include docs for the built-in loaders Content Loader API: include docs for the built-in loaders Jan 15, 2025
@ArmandPhilippot ArmandPhilippot marked this pull request as ready for review January 15, 2025 18:12
@sarah11918
Copy link
Member

Sorry I've been busy the last couple of days and haven't replied, but this is fantastic! I thought I was going to have to get on this myself today or tomorrow. 😄

Was thinking we could look at this on Talking and Doc'ing tomorrow! 🎉

@sarah11918
Copy link
Member

Discussed on talking and doc'ing:

Content and comprehensiveness are excellent! This is the content we want, just need to incorporate it into the rest of docs fully:

  • move this section to after What is a loader?
  • following, is geared towards creating your own loader (vs built in)
  • rename those following headings e.g. Object loader API
  • link to these items from content collections guide now that we have reference items
  • still general text edits to be made (e.g. pattern should mention glob)
  • micromatch docs aren't super great -- should we link to a glob playground too (check original issues for resources) so they can confirm their pattern is valid? (getting the syntax perfect is now more important with collections v5, so the more guidance the better)

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jan 16, 2025
@ArmandPhilippot
Copy link
Member Author

I think I made all the updates. I posted again one of my original comments (content has moved) because I'm still not sure this is accurate. Other than that, I think it's ready to you to check the wording when you'll have time @sarah11918! I have reworded some sentences mentioned during T&D but... well, I'm not the expert here. 😄

Note: I had to update a translation to fix a link: zh-cn/reference/modules/astro-content.mdx.

@liruifengv
Copy link
Member

zh-cn LGTM! I will update this link after Content Loader reference was translated.

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.

Just a couple of Oxford commas, but this looks outstanding, Armand! 🥳 Thank you so much for taking this on! 💪

Co-authored-by: Sarah Rainsberger <[email protected]>
@ArmandPhilippot
Copy link
Member Author

Wow, thanks @sarah11918! I wasn't sure my rewording would be enough. 🙌🏽

Do we need a Lunaria directive here? I'm asking because I updated a translation and while I've observed how things have been done in the past, I'm not sure I understand when it's necessary/how it works.

@yanthomasdev
Copy link
Member

Do we need a Lunaria directive here?

Yes, @ArmandPhilippot! The zh-cn translation of the page isn't 100% updated with English, so we'd like to keep the outdated status. If it were completely updated, it wouldn't be necessary.

Here's the directive you can paste into the commit body during merging:

@lunaria-track:src/content/docs/en/guides/content-collections.mdx;src/content/docs/en/reference/content-loader-reference.mdx;src/content/docs/en/reference/modules/astro-content.mdx

@ArmandPhilippot
Copy link
Member Author

Ok, so basically in these cases I just have to remember to list the paths of the English versions separated by a semicolon (with the prefix of course). Thanks for the explanations, @yanthomasdev! 🫡 (I saw these directives, but didn't look at them more closely before... 😅 )

Well, let's see! 🤞🏽

@ArmandPhilippot ArmandPhilippot merged commit 9807f1a into withastro:main Jan 20, 2025
10 checks passed
@ArmandPhilippot ArmandPhilippot deleted the feat/content-loaders-doc branch January 20, 2025 21:11
thomasbnt added a commit to thomasbnt/docs that referenced this pull request Jan 21, 2025
thomasbnt added a commit to thomasbnt/docs that referenced this pull request Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide documentation on generating custom IDs using the glob loader Improve built-in loader docs
5 participants