0.1.0 • Published 2 years ago

@astropub/contentful v0.1.0

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
2 years ago

Astro Contentful

Astro Contentful lets you use Contentful in Astro.

NPM Version Open in StackBlitz

---
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!