@astropub/contentful
v0.1.0
Published
Use Contentful in Astro
Downloads
9
Maintainers
Readme
Astro Contentful
Astro Contentful lets you use Contentful in Astro.
---
import Entry from '@astropub/contentful:entries/t1h1x38!astro'
---
<h1>
<Entry of="title" />
</h1>
<Entry of="content">
<p>Fallback content.</p>
</Entry>
---
import EntryList from '@astropub/contentful:entries?content_type=blog!astro'
---
<EntryList>{
Entry => (
<h1>
<Entry of="title" />
</h1>
<Entry of="content">
<p>Fallback content.</p>
</Entry>
)
}</EntryList>
Usage
Install Astro Contentful to your project.
npm install @astropub/contentful
Use Astro Contentful components in your project.
---
// data
import entry from '@astropub/contentful:entries/t1h1x38'
import entryList from '@astropub/contentful:entries'
import oneEntryList from '@astropub/contentful:entries?content_type=blog'
// components
import Entry from '@astropub/contentful:entries/t1h1x38!astro'
import EntryList from '@astropub/contentful:entries!astro'
import oneEntryList from '@astropub/contentful:entries?content_type=blog!astro'
---
Enjoy!