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: Add example to render list of contents #8364

Closed
wants to merge 3 commits into from

Conversation

tordans
Copy link
Contributor

@tordans tordans commented May 21, 2024

Description (required)

I was looking all over for an example on how to use the render() function to render a list of blog posts like on any old WordPress index page.

It turns out, one can just pass the Content component in a custom object and render this as <Content/> just like always.

I think it would be great to mention this somewhere. I cannot be the only one searching for this? :-D.

Please feel free to change this PR as you see fit.

=> This is the section in the preview

Related issues & labels (optional)

./.

Copy link

vercel bot commented May 21, 2024

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

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview May 22, 2024 2:26pm

@astrobot-houston
Copy link
Contributor

astrobot-houston commented May 21, 2024

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

Locale File Note
en guides/content-collections.mdx Source changed, localizations will be marked as outdated.
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.

@sarah11918
Copy link
Member

We've discussed this PR and don't think this fits our needs in that section, which is only meant to show the functions used, and not the various ways in which they can be used. So I'll be closing this PR, but thank you as always for contributing! 🙌

@sarah11918 sarah11918 closed this Jun 14, 2024
@tordans tordans deleted the patch-4 branch June 14, 2024 20:20
@tordans
Copy link
Contributor Author

tordans commented Jun 14, 2024

@sarah11918 thank you for your feedback. Can you help me understand where in the docs I can find information on how to render a list of full posts like I would do with any WordPress side? In case I am right and there is none, do you consider it a trivial thing to find out by oneself … or do you consider it a non-relevant use case for Astro to render full lists of content?

@tordans
Copy link
Contributor Author

tordans commented Dec 9, 2024

Reverse ping #10317 which will show how to create a list of content for RSS.

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.

3 participants