0.9.6 • Published 8 months ago
nuxt-contentful-pages v0.9.6
Nuxt Contentful Pages
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
9 months ago
0.9.3
9 months ago
0.9.6
8 months ago
0.9.5
8 months ago
0.0.10
12 months ago
0.0.11
11 months ago
0.0.14
11 months ago
0.0.3
12 months ago
0.0.9
12 months ago
0.0.8
12 months ago
0.9.2
10 months ago
0.9.1
10 months ago
0.0.5
12 months ago
0.0.4
12 months ago
0.0.7
12 months ago
0.0.6
12 months ago
0.0.2
1 year ago