0.9.6 • Published 9 months ago

nuxt-contentful-pages v0.9.6

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Nuxt Contentful Pages

npm version npm downloads License Nuxt

A Nuxt module for easy use of pages from Contentful

Features

  • Nuxt 3 ready
  • Contentful Integration

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add nuxt-contentful-pages

Then add your contentful space id and access token

CONTENTFUL_SPACE_ID=<YOUR_SPACE_ID>
CONTENTFUL_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN>

To get all wired up you need to add the NuxtPage component to your App.vue

<template>
  <div>
    <NuxtPage />
  </div>
</template>

and add a page /page/...slug.vue to handle all requests like the example below

<template>
    
    <div>        
        <div v-html="page?.body"></div>        
    </div>    
</template>
<script setup lang="ts">

  // import your type matching the fields in your Contentful content type
  import { type StandardPage } from '../types/StandardPage'


  // Get the page
  //
  const page = await useFetchContentfulPageBySlug<StandardPage>('standardPage')

</script>

```bash



That's it! You can now use Contentful in your Nuxt app ✨


## Contribution

<details>
  <summary>Local development</summary>
  
  ```bash
  # Install dependencies
  npm install
  
  # Generate type stubs
  npm run dev:prepare
  
  # Develop with the playground
  npm run dev
  
  # Build the playground
  npm run dev:build
  
  # Run ESLint
  npm run lint
  
  # Run Vitest
  npm run test
  npm run test:watch
  
  # Release new version
  npm run release
0.9.4

10 months ago

0.9.3

10 months ago

0.9.6

9 months ago

0.9.5

9 months ago

0.0.10

1 year ago

0.0.11

12 months ago

0.0.14

11 months ago

0.0.3

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.9.2

11 months ago

0.9.1

11 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago