Unverified Commit fa88095f authored by Tim's avatar Tim Committed by GitHub

examples: Update Example Prepr CMS (#49224)

Co-authored-by: 's avatarKevintjuhz <kevin@kqcreations.com>
Co-authored-by: 's avatarKevintjuhz <k.quaedvlieg@outlook.com>
Co-authored-by: 's avatarLee Robinson <me@leerob.io>
parent 4ee4458d
...@@ -17,24 +17,28 @@ Once you have access to [the environment variables you'll need](#step-15-set-up- ...@@ -17,24 +17,28 @@ Once you have access to [the environment variables you'll need](#step-15-set-up-
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [WordPress](/examples/cms-wordpress)
- [Blog Starter](/examples/blog-starter)
## How to use ## How to use
......
...@@ -83,19 +83,25 @@ Alternatively, you can deploy using our template by clicking on the Deploy butto ...@@ -83,19 +83,25 @@ Alternatively, you can deploy using our template by clicking on the Deploy butto
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [Strapi](/examples/cms-strapi) - [DatoCMS](/examples/cms-datocms)
- [ButterCMS](/examples/cms-buttercms)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Blog Starter](/examples/blog-starter)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [WordPress](/examples/cms-wordpress)
- [Blog Starter](/examples/blog-starter)
...@@ -18,24 +18,28 @@ Once you have access to your Butter API token, you can deploy your Butterized pr ...@@ -18,24 +18,28 @@ Once you have access to your Butter API token, you can deploy your Butterized pr
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [Strapi](/examples/cms-strapi) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,24 +14,28 @@ Using the Deploy Button below, you'll deploy the Next.js project as well as conn ...@@ -14,24 +14,28 @@ Using the Deploy Button below, you'll deploy the Next.js project as well as conn
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [Builder.io](/examples/cms-builder-io)
- [ButterCMS](/examples/cms-buttercms)
- [Contentful](/examples/cms-contentful)
- [Cosmic](/examples/cms-cosmic)
- [DatoCMS](/examples/cms-datocms) - [DatoCMS](/examples/cms-datocms)
- [Sanity](/examples/cms-sanity) - [DotCMS](/examples/cms-dotcms)
- [TakeShape](/examples/cms-takeshape) - [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic) - [Prismic](/examples/cms-prismic)
- [Strapi](/examples/cms-strapi) - [Sanity](/examples/cms-sanity)
- [Agility CMS](/examples/cms-agilitycms) - [Sitefinity](/examples/cms-sitefinity)
- [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms)
- [Storyblok](/examples/cms-storyblok) - [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms) - [TakeShape](/examples/cms-takeshape)
- [Kontent](/examples/cms-kontent) - [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Ghost](/examples/cms-ghost) - [Webiny](/examples/cms-webiny)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io) - [WordPress](/examples/cms-wordpress)
- [DotCMS](/examples/cms-dotcms)
- [Enterspeed](/examples/cms-enterspeed)
## How to use ## How to use
......
...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e ...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [Builder.io](/examples/cms-builder-io)
- [ButterCMS](/examples/cms-buttercms)
- [Contentful](/examples/cms-contentful)
- [Cosmic](/examples/cms-cosmic)
- [DatoCMS](/examples/cms-datocms) - [DatoCMS](/examples/cms-datocms)
- [Sanity](/examples/cms-sanity) - [DotCMS](/examples/cms-dotcms)
- [TakeShape](/examples/cms-takeshape) - [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic) - [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Sanity](/examples/cms-sanity)
- [Strapi](/examples/cms-strapi) - [Sitefinity](/examples/cms-sitefinity)
- [Agility CMS](/examples/cms-agilitycms)
- [ButterCMS](/examples/cms-buttercms)
- [Storyblok](/examples/cms-storyblok) - [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms) - [TakeShape](/examples/cms-takeshape)
- [Kontent](/examples/cms-kontent) - [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Ghost](/examples/cms-ghost) - [Webiny](/examples/cms-webiny)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io) - [WordPress](/examples/cms-wordpress)
- [DotCMS](/examples/cms-dotcms)
- [Enterspeed](/examples/cms-enterspeed)
## How to use ## How to use
......
...@@ -8,24 +8,28 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas ...@@ -8,24 +8,28 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [Sanity](/examples/cms-sanity) - [Builder.io](/examples/cms-builder-io)
- [TakeShape](/examples/cms-takeshape) - [ButterCMS](/examples/cms-buttercms)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## Deploy your own ## Deploy your own
......
...@@ -14,21 +14,28 @@ Using the Deploy Button below, you'll deploy the Next.js project. ...@@ -14,21 +14,28 @@ Using the Deploy Button below, you'll deploy the Next.js project.
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [Builder.io](/examples/cms-builder-io)
- [ButterCMS](/examples/cms-buttercms)
- [Contentful](/examples/cms-contentful)
- [Cosmic](/examples/cms-cosmic)
- [DatoCMS](/examples/cms-datocms) - [DatoCMS](/examples/cms-datocms)
- [Sanity](/examples/cms-sanity) - [DotCMS](/examples/cms-dotcms)
- [TakeShape](/examples/cms-takeshape) - [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic) - [Prismic](/examples/cms-prismic)
- [Strapi](/examples/cms-strapi) - [Sanity](/examples/cms-sanity)
- [Agility CMS](/examples/cms-agilitycms) - [Sitefinity](/examples/cms-sitefinity)
- [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms)
- [Storyblok](/examples/cms-storyblok) - [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms) - [TakeShape](/examples/cms-takeshape)
- [Kontent](/examples/cms-kontent) - [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Ghost](/examples/cms-ghost) - [Webiny](/examples/cms-webiny)
- [Contentful](/examples/cms-contentful)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,23 +14,28 @@ Once you have [configured the Next.js module for Drupal](https://next-drupal.org ...@@ -14,23 +14,28 @@ Once you have [configured the Next.js module for Drupal](https://next-drupal.org
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok) - [DotCMS](/examples/cms-dotcms)
- [Kontent](/examples/cms-kontent) - [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost) - [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms) - [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [DotCMS](/examples/cms-dotcms) - [WordPress](/examples/cms-wordpress)
- [Enterspeed](/examples/cms-enterspeed)
## How to use ## How to use
......
...@@ -14,22 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e ...@@ -14,22 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok) - [DotCMS](/examples/cms-dotcms)
- [GraphCMS](/examples/cms-graphcms) - [Drupal](/examples/cms-drupal)
- [Kontent](/examples/cms-kontent) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost) - [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io) - [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -13,23 +13,28 @@ Once you have access to [the environment variables you'll need](#step-2-set-up-e ...@@ -13,23 +13,28 @@ Once you have access to [the environment variables you'll need](#step-2-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [Builder.io](/examples/cms-builder-io)
- [ButterCMS](/examples/cms-buttercms)
- [Contentful](/examples/cms-contentful)
- [Cosmic](/examples/cms-cosmic)
- [DatoCMS](/examples/cms-datocms) - [DatoCMS](/examples/cms-datocms)
- [Sanity](/examples/cms-sanity) - [DotCMS](/examples/cms-dotcms)
- [TakeShape](/examples/cms-takeshape) - [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic) - [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Sanity](/examples/cms-sanity)
- [Strapi](/examples/cms-strapi) - [Sitefinity](/examples/cms-sitefinity)
- [Agility CMS](/examples/cms-agilitycms)
- [ButterCMS](/examples/cms-buttercms)
- [Storyblok](/examples/cms-storyblok) - [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms) - [TakeShape](/examples/cms-takeshape)
- [Kontent](/examples/cms-kontent) - [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore) - [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io) - [WordPress](/examples/cms-wordpress)
- [DotCMS](/examples/cms-dotcms)
- [Enterspeed](/examples/cms-enterspeed)
## How to use ## How to use
......
...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e ...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
PREPRIO_API=https://graphql.prepr.io/graphql PREPRIO_API=https://graphql.prepr.io/graphql
PREPRIO_PRODUCTION_TOKEN= PREPRIO_PRODUCTION_TOKEN=
PREPRIO_PREVIEW_TOKEN= PREPRIO_PREVIEW_TOKEN=
PREPRIO_PREVIEW_KEY= PREPRIO_PREVIEW_SECRET=YOURSECRET
\ No newline at end of file \ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# misc # misc
.DS_Store .DS_Store
*.pem *.pem
.env
# debug # debug
npm-debug.log* npm-debug.log*
......
This diff is collapsed.
import Container from './container' import Container from './container'
import cn from 'classnames' import cn from 'classnames'
import { EXAMPLE_PATH } from '../lib/constants' import { EXAMPLE_PATH } from '@/lib/constants'
export default function Alert({ preview }) { export default function Alert({ preview }) {
return ( return (
...@@ -14,7 +14,7 @@ export default function Alert({ preview }) { ...@@ -14,7 +14,7 @@ export default function Alert({ preview }) {
<div className="py-2 text-center text-sm"> <div className="py-2 text-center text-sm">
{preview ? ( {preview ? (
<> <>
This page is a preview.{' '} This is page is a preview.{' '}
<a <a
href="/api/exit-preview" href="/api/exit-preview"
className="underline hover:text-cyan duration-200 transition-colors" className="underline hover:text-cyan duration-200 transition-colors"
......
import cn from 'classnames'
import Image from 'next/image' import Image from 'next/image'
import Link from 'next/link' import Link from 'next/link'
import cn from 'classnames'
export default function CoverImage({ title, url, slug }) { export default function CoverImage({ title, url, slug }) {
const image = ( const image = (
...@@ -8,13 +8,12 @@ export default function CoverImage({ title, url, slug }) { ...@@ -8,13 +8,12 @@ export default function CoverImage({ title, url, slug }) {
width={2000} width={2000}
height={1000} height={1000}
alt={`Cover Image for ${title}`} alt={`Cover Image for ${title}`}
src={url}
className={cn('shadow-small', { className={cn('shadow-small', {
'hover:shadow-medium transition-shadow duration-200': slug, 'hover:shadow-medium transition-shadow duration-200': slug,
})} })}
src={url}
/> />
) )
return ( return (
<div className="sm:mx-0"> <div className="sm:mx-0">
{slug ? ( {slug ? (
......
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
export default function Date({ dateString }) { export default function Date({ dateString }) {
const date = parseISO(dateString) const date = parseISO(dateString)
return <time dateTime={dateString}>{format(date, 'LLLL d, yyyy')}</time> return <time dateTime={date}>{format(date, 'LLLL d, yyyy')}</time>
} }
import Container from './container' import Container from './container'
import { EXAMPLE_PATH } from '../lib/constants' import { EXAMPLE_PATH } from '@/lib/constants'
export default function Footer() { export default function Footer() {
return ( return (
......
import Avatar from '../components/avatar' import Avatar from './avatar'
import Date from '../components/date' import Date from './date'
import CoverImage from '../components/cover-image' import CoverImage from './cover-image'
import Link from 'next/link' import Link from 'next/link'
export default function HeroPost({ export default function HeroPost({
...@@ -14,25 +14,27 @@ export default function HeroPost({ ...@@ -14,25 +14,27 @@ export default function HeroPost({
return ( return (
<section> <section>
<div className="mb-8 md:mb-16"> <div className="mb-8 md:mb-16">
<CoverImage slug={slug} title={title} url={coverImage} /> <CoverImage title={title} url={coverImage} slug={slug} />
</div> </div>
<div className="mb-20 md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 md:mb-28"> <div className="md:grid md:grid-cols-2 md:gap-x-16 lg:gap-x-8 mb-20 md:mb-28">
<div> <div>
<h3 className="mb-4 text-4xl leading-tight lg:text-6xl"> <h3 className="mb-4 text-4xl lg:text-6xl leading-tight">
<Link href={`/posts/${slug}`} className="hover:underline"> <Link href={`/posts/${slug}`} className="hover:underline">
{title} {title}
</Link> </Link>
</h3> </h3>
<div className="mb-4 text-lg md:mb-0"> {date && (
<Date dateString={date} /> <div className="mb-4 md:mb-0 text-lg">
</div> <Date dateString={date} />
</div>
)}
</div> </div>
<div> <div>
<p className="mb-4 text-lg leading-relaxed">{excerpt}</p> <div
<Avatar className="text-lg leading-relaxed mb-4"
name={author.name} dangerouslySetInnerHTML={{ __html: excerpt }}
picture={author.cover[0].cdn_files[0].url} ></div>
/> <Avatar name={author.full_name} picture={author.profile_pic[0].url} />
</div> </div>
</div> </div>
</section> </section>
......
import { CMS_NAME, CMS_URL } from '../lib/constants' import { CMS_NAME, CMS_URL } from '@/lib/constants'
export default function Intro() { export default function Intro() {
return ( return (
......
import Alert from '../components/alert' import Alert from './alert'
import Footer from '../components/footer' import Footer from './footer'
import Meta from '../components/meta' import Meta from './meta'
export default function Layout({ preview, children }) { export default function Layout({ preview, children }) {
return ( return (
......
.markdown {
@apply text-lg leading-relaxed;
}
.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote {
@apply my-6;
}
.markdown h2 {
@apply text-3xl mt-12 mb-4 leading-snug;
}
.markdown h3 {
@apply text-2xl mt-8 mb-4 leading-snug;
}
import Head from 'next/head' import Head from 'next/head'
import { CMS_NAME, HOME_OG_IMAGE_URL } from '../lib/constants' import { CMS_NAME, HOME_OG_IMAGE_URL } from '@/lib/constants'
export default function Meta() { export default function Meta() {
return ( return (
......
import PostPreview from '../components/post-preview' import PostPreview from './post-preview'
export default function MoreStories({ posts }) { export default function MoreStories({ posts }) {
return ( return (
...@@ -11,11 +11,11 @@ export default function MoreStories({ posts }) { ...@@ -11,11 +11,11 @@ export default function MoreStories({ posts }) {
<PostPreview <PostPreview
key={post._slug} key={post._slug}
title={post.title} title={post.title}
coverImage={post.cover[0].cdn_files[0].url} coverImage={post.cover[0].url}
date={post.date} date={post._publish_on}
author={post.author[0]} author={post.authors[0]}
slug={post._slug} slug={post._slug}
excerpt={post.summary} excerpt={post.excerpt}
/> />
))} ))}
</div> </div>
......
import postStyles from './post-styles.module.css' import Image from 'next/image'
export default function PostBody({ content }) { export default function PostBody({ content }) {
return ( const renderedContent = content.map((item) => {
<div if (item.__typename === 'Text') {
className={`max-w-2xl mx-auto post ${postStyles.post}`} return <div dangerouslySetInnerHTML={{ __html: item.html }}></div>
dangerouslySetInnerHTML={{ __html: content }} } else if (item.__typename === 'Image') {
/> return <Image src={item.url} alt="image" width={1000} height={500} />
) } else {
return null
}
})
return <div className="max-w-2xl mx-auto article">{renderedContent}</div>
} }
...@@ -8,21 +8,20 @@ export default function PostHeader({ title, coverImage, date, author }) { ...@@ -8,21 +8,20 @@ export default function PostHeader({ title, coverImage, date, author }) {
<> <>
<PostTitle>{title}</PostTitle> <PostTitle>{title}</PostTitle>
<div className="hidden md:block md:mb-12"> <div className="hidden md:block md:mb-12">
<Avatar name={author.name} picture={author.cover[0].cdn_files[0].url} /> <Avatar name={author.full_name} picture={author.profile_pic[0].url} />
</div> </div>
<div className="mb-8 -mx-5 md:mb-16 sm:mx-0"> <div className="mb-8 md:mb-16 sm:mx-0">
<CoverImage title={title} url={coverImage} /> <CoverImage title={title} url={coverImage} />
</div> </div>
<div className="max-w-2xl mx-auto"> <div className="max-w-2xl mx-auto">
<div className="block mb-6 md:hidden"> <div className="block md:hidden mb-6">
<Avatar <Avatar name={author.full_name} picture={author.profile_pic[0].url} />
name={author.name}
picture={author.cover[0].cdn_files[0].url}
/>
</div>
<div className="mb-6 text-lg">
<Date dateString={date} />
</div> </div>
{date && (
<div className="mb-6 text-lg">
<Date dateString={date} />
</div>
)}
</div> </div>
</> </>
) )
......
import Avatar from '../components/avatar' import Avatar from './avatar'
import Date from '../components/date' import Date from './date'
import CoverImage from './cover-image' import CoverImage from './cover-image'
import Link from 'next/link' import Link from 'next/link'
...@@ -16,16 +16,21 @@ export default function PostPreview({ ...@@ -16,16 +16,21 @@ export default function PostPreview({
<div className="mb-5"> <div className="mb-5">
<CoverImage slug={slug} title={title} url={coverImage} /> <CoverImage slug={slug} title={title} url={coverImage} />
</div> </div>
<h3 className="mb-3 text-3xl leading-snug"> <h3 className="text-3xl mb-3 leading-snug">
<Link href={`/posts/${slug}`} className="hover:underline"> <Link href={`/posts/${slug}`} className="hover:underline">
{title} {title}
</Link> </Link>
</h3> </h3>
<div className="mb-4 text-lg"> {date && (
<Date dateString={date} /> <div className="text-lg mb-4">
</div> <Date dateString={date} />
<p className="mb-4 text-lg leading-relaxed">{excerpt}</p> </div>
<Avatar name={author.name} picture={author.cover[0].cdn_files[0].url} /> )}
<div
className="text-lg leading-relaxed mb-4"
dangerouslySetInnerHTML={{ __html: excerpt }}
></div>
<Avatar name={author.full_name} picture={author.profile_pic[0].url} />
</div> </div>
) )
} }
.post {
@apply text-lg leading-relaxed;
}
.post p,
.post ul,
.post ol,
.post blockquote {
@apply my-6;
}
.post h1 {
@apply mt-12 mb-4 text-4xl leading-snug;
}
.post h2 {
@apply mt-12 mb-4 text-3xl leading-snug;
}
.post h3 {
@apply mt-8 mb-4 text-2xl leading-snug;
}
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": "." "baseUrl": ".",
"paths": {
"@/components/*": ["components/*"],
"@/lib/*": ["lib/*"],
"@/styles/*": ["styles/*"]
}
} }
} }
async function fetchAPI(query, { variables, preview } = {}) {
const response = await fetch(process.env.PREPRIO_API, {
method: 'POST',
headers: {
Authorization:
'Bearer ' +
(preview
? process.env.PREPRIO_PREVIEW_TOKEN
: process.env.PREPRIO_PRODUCTION_TOKEN),
},
body: JSON.stringify({
query,
variables,
}),
})
const result = await response.json()
return result
}
export async function getPreviewPostBySlug(slug) {
const { data } = await fetchAPI(
`
query ArticleBySlug($slug: String!) {
Article(slug: $slug) {
_slug
}
}
`,
{
preview: true,
variables: {
slug,
},
}
)
return data.Article
}
export async function getAllPostsWithSlug() {
const { data } = await fetchAPI(
`
{
Articles {
items {
_slug
}
}
}
`,
{ preview: true }
)
return data?.Articles.items
}
export async function getAllPostsForHome(preview) {
const { data } = await fetchAPI(
`
{
Articles(sort: publish_on_DESC) {
items {
_id
_slug
_publish_on
title
excerpt
content {
...on Text {
html
text
}
}
authors {
full_name
profile_pic {
url
}
}
cover {
url(preset: "square")
}
}
}
}
`,
{ preview }
)
return data?.Articles.items
}
export async function getPostAndMorePosts(slug, preview) {
const { data } = await fetchAPI(
`
query ArticlesBySlug($slug: String!) {
Article(slug: $slug) {
_id
_slug
_publish_on
title
excerpt
content {
__typename
... on Text {
html
text
}
... on Assets {
items {
url
}
}
}
authors {
full_name
profile_pic {
url
}
}
cover {
url(preset: "square")
}
}
MoreArticles: Articles(limit: 3, sort: publish_on_DESC) {
items {
_id
_slug
_publish_on
title
excerpt
cover {
url(preset: "square")
}
content {
... on Text {
html
text
}
}
authors {
full_name
profile_pic {
url
}
}
}
}
}
`,
{
preview,
variables: {
slug,
},
}
)
return {
post: data?.Article,
morePosts: (data?.MoreArticles?.items || [])
.filter((item) => item._slug !== slug)
.slice(0, 2),
}
}
import { createPreprClient } from '@preprio/nodejs-sdk'
const prepr = createPreprClient({
token: process.env.PREPRIO_PRODUCTION_TOKEN,
timeout: 4000,
baseUrl: process.env.PREPRIO_API,
})
export { prepr }
export async function getAllPostsForHome(preview) {
// Query publications
const data =
(await prepr
.graphqlQuery(
`
query {
Posts {
items {
_id,
_slug,
date: _publish_on
title,
summary,
author {
name
cover {
cdn_files {
url(width: 100, height:100)
}
}
}
cover {
cdn_files {
url(width:2000, height:1000)
}
}
}
}
}`
)
.token(
preview
? process.env.PREPRIO_PREVIEW_TOKEN
: process.env.PREPRIO_PRODUCTION_TOKEN
)
.fetch()) || []
return data.data.Posts.items
}
export async function getAllPostsWithSlug() {
// Query publications
const data =
(await prepr
.graphqlQuery(
`
query {
Posts {
items {
slug : _slug,
}
}
}`
)
.fetch()) || []
return data.data.Posts.items
}
export async function getPostAndMorePosts(slug, preview) {
// Query publications
const data =
(await prepr
.graphqlQuery(
`
query slugPost($slug: String!) {
Post ( slug : $slug) {
_id,
_slug,
date: _publish_on
title,
summary,
content,
author {
name
cover {
cdn_files {
url(width: 100, height:100)
}
}
}
cover {
cdn_files {
url(width:2000, height:1000)
}
}
}
morePosts : Posts(where : { _slug_nany : [$slug] }) {
items {
_id,
_slug,
date: _publish_on
title,
summary,
author {
name
cover {
cdn_files {
url(width: 100, height:100)
}
}
}
cover {
cdn_files {
url(width:2000, height:1000)
}
}
}
}
}`
)
.graphqlVariables({
slug: slug,
})
.token(
preview
? process.env.PREPRIO_PREVIEW_TOKEN
: process.env.PREPRIO_PRODUCTION_TOKEN
)
.fetch()) || []
return data.data
}
export async function getPreviewPostBySlug(slug) {
// Query publications
const data =
(await prepr
.graphqlQuery(
`
query preview($slug: String!) {
Post ( slug : $slug) {
_id,
slug : _slug
}
}`
)
.token(process.env.PREPRIO_PREVIEW_TOKEN)
.graphqlVariables({
slug: slug,
})
.fetch()) || []
return data.data.Post
}
{
"id": "f7153965-7bc9-4b9b-b964-49129b34c5e8",
"created_on": "2021-03-04T12:03:46+00:00",
"changed_on": "2021-03-04T12:03:46+00:00",
"body": "Author",
"description": null,
"label": "PublicationModel",
"status": "published",
"stories": false,
"timelines": false,
"allow_stories": false,
"channels": false,
"allow_channels": false,
"container_required": false,
"channels_required": false,
"seo_score": false,
"ab_testing": false,
"versioning": false,
"slug": null,
"for": null,
"fields": [
{
"type": "Text",
"required": false,
"preview": true,
"body": "Name",
"view": "single_line",
"localized": true,
"id": "fd7f062f-84e4-4362-9e15-61c1a26a4078",
"api_id": "name",
"created_on": "2021-03-04T12:03:55+00:00",
"changed_on": "2021-03-04T12:03:55+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": "single_line",
"accept_restrictions": null,
"no_html": false
},
{
"accept": ["photo"],
"max": "1",
"preview": true,
"type": "Asset",
"min": "1",
"required": true,
"body": "Cover Image",
"localized": true,
"id": "fd81a8e2-2f59-44b7-b3b2-873a27958db1",
"api_id": "cover",
"created_on": "2021-03-04T12:04:13+00:00",
"changed_on": "2021-03-04T12:04:13+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": null,
"accept_restrictions": null,
"presets_change_required": false
}
]
}
{
"id": "4da8ca3d-86c2-40ba-84c0-5ea949293b9b",
"created_on": "2021-03-04T12:02:44+00:00",
"changed_on": "2021-03-04T12:10:37+00:00",
"body": "Post",
"description": null,
"label": "PublicationModel",
"status": "published",
"stories": false,
"timelines": false,
"allow_stories": false,
"channels": false,
"allow_channels": false,
"container_required": false,
"channels_required": false,
"seo_score": false,
"ab_testing": false,
"versioning": false,
"slug": "{title}",
"for": null,
"fields": [
{
"type": "Text",
"required": false,
"preview": true,
"body": "Title",
"view": "single_line",
"localized": true,
"id": "7aa96451-d3b5-41e9-b012-77f66dd2213b",
"api_id": "title",
"created_on": "2021-03-04T12:02:49+00:00",
"changed_on": "2021-03-04T12:02:49+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": "single_line",
"accept_restrictions": null,
"no_html": false
},
{
"type": "Text",
"required": false,
"preview": true,
"body": "Summary",
"view": "textarea",
"localized": true,
"id": "ea6a35ca-5a39-4786-9cf7-15e917a0dcf4",
"api_id": "summary",
"created_on": "2021-03-04T12:02:59+00:00",
"changed_on": "2021-03-04T12:02:59+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": "textarea",
"accept_restrictions": null,
"no_html": false
},
{
"accept": [
"bold",
"italic",
"underline",
"unordered-list",
"ordered-list",
"link",
"table"
],
"preview": true,
"view": "html_editor",
"type": "Text",
"required": false,
"body": "Content",
"localized": true,
"id": "cd31e930-a08c-4740-903e-5c41fcd1c555",
"api_id": "content",
"created_on": "2021-03-04T12:04:36+00:00",
"changed_on": "2021-03-04T12:04:36+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": "html_editor",
"accept_restrictions": null,
"no_html": false
},
{
"accept": ["photo"],
"max": "1",
"preview": true,
"type": "Asset",
"min": "1",
"required": true,
"body": "Cover Image",
"localized": true,
"id": "cfca83f3-5a73-4567-bde1-4adeb57915d0",
"api_id": "cover",
"created_on": "2021-03-04T12:03:17+00:00",
"changed_on": "2021-03-04T12:03:17+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": null,
"accept_restrictions": null,
"presets_change_required": false
},
{
"type": "Publication",
"min": "1",
"required": true,
"max": "1",
"preview": false,
"body": "Author",
"localized": true,
"id": "8308380f-af0a-40e7-ae30-33b2f7ce93d9",
"api_id": "author",
"created_on": "2021-03-04T12:04:51+00:00",
"changed_on": "2021-03-04T12:04:51+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"description": null,
"disable_editing": false,
"appearance": null,
"accept_restrictions": null,
"publication_models": {
"items": [
{
"id": "7214e365-1b4c-4de3-8412-e311250fb4da",
"body": "Author"
}
],
"total": 1
}
},
{
"type": "Slug",
"description": "The slug is generated automatically. You can change the slug, as long as it is unique.",
"body": "Slug",
"id": "7214e365-1b4c-4de3-8412-e311250fb4da",
"api_id": null,
"created_on": "2021-03-04T12:03:32+00:00",
"changed_on": "2021-03-04T12:03:32+00:00",
"label": "PublicationModelField",
"title": false,
"seo_title": false,
"seo_description": false,
"required": false,
"localized": false,
"preview": false,
"disable_editing": false,
"appearance": null,
"accept_restrictions": null
}
]
}
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
module.exports = { module.exports = {
images: { images: {
domains: ['b-cdn.net'], domains: [
'b-cdn.net',
'prepr-example-content-demo-patterns.stream.prepr.io',
'demo-site-patterns.stream.prepr.io',
],
}, },
} }
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"@preprio/nodejs-sdk": "^1.1.0",
"classnames": "2.3.1", "classnames": "2.3.1",
"date-fns": "2.28.0", "date-fns": "2.28.0",
"next": "latest", "next": "latest",
......
import '../styles/index.css' import '@/styles/index.css'
function MyApp({ Component, pageProps }) { function MyApp({ Component, pageProps }) {
return <Component {...pageProps} /> return <Component {...pageProps} />
......
import { getPreviewPostBySlug } from '../../lib/preprio' import { getPreviewPostBySlug } from '../../lib/api'
export default async function handler(req, res) { export default async function handler(req, res) {
// Check the secret and next parameters // Check the secret and next parameters
// This secret should only be known to this API route and the CMS // This secret should only be known to this API route and the CMS
if (req.query.secret !== process.env.PREPRIO_PREVIEW_KEY || !req.query.slug) {
if (
req.query.secret !== process.env.PREPRIO_PREVIEW_SECRET ||
!req.query.slug
) {
return res.status(401).json({ message: 'Invalid token' }) return res.status(401).json({ message: 'Invalid token' })
} }
...@@ -20,6 +24,6 @@ export default async function handler(req, res) { ...@@ -20,6 +24,6 @@ export default async function handler(req, res) {
// Redirect to the path from the fetched post // Redirect to the path from the fetched post
// We don't redirect to req.query.slug as that might lead to open redirect vulnerabilities // We don't redirect to req.query.slug as that might lead to open redirect vulnerabilities
res.writeHead(307, { Location: `/posts/${post.slug}` }) res.writeHead(307, { Location: `/posts/${post._slug}` })
res.end() res.end()
} }
import Container from '../components/container' import Container from '@/components/container'
import MoreStories from '../components/more-stories' import MoreStories from '@/components/more-stories'
import HeroPost from '../components/hero-post' import HeroPost from '@/components/hero-post'
import Intro from '../components/intro' import Intro from '@/components/intro'
import Layout from '../components/layout' import Layout from '@/components/layout'
import { getAllPostsForHome } from '../lib/preprio' import { getAllPostsForHome } from '@/lib/api'
import Head from 'next/head' import Head from 'next/head'
import { CMS_NAME } from '../lib/constants' import { CMS_NAME } from '@/lib/constants'
export default function Index({ posts, preview }) { export default function Index({ allPosts, preview }) {
const heroPost = posts[0] const heroPost = allPosts[0]
const morePosts = posts.slice(1)
const morePosts = allPosts.slice(1)
return ( return (
<> <>
<Layout preview={preview}> <Layout preview={preview}>
...@@ -21,11 +22,11 @@ export default function Index({ posts, preview }) { ...@@ -21,11 +22,11 @@ export default function Index({ posts, preview }) {
{heroPost && ( {heroPost && (
<HeroPost <HeroPost
title={heroPost.title} title={heroPost.title}
coverImage={heroPost.cover[0].cdn_files[0].url} coverImage={heroPost.cover[0].url}
date={heroPost.date} date={heroPost._publish_on}
author={heroPost.author[0]} author={heroPost.authors[0]}
slug={heroPost._slug} slug={heroPost._slug}
excerpt={heroPost.summary} excerpt={heroPost.excerpt}
/> />
)} )}
{morePosts.length > 0 && <MoreStories posts={morePosts} />} {morePosts.length > 0 && <MoreStories posts={morePosts} />}
...@@ -35,10 +36,9 @@ export default function Index({ posts, preview }) { ...@@ -35,10 +36,9 @@ export default function Index({ posts, preview }) {
) )
} }
export async function getStaticProps({ preview = false }) { export async function getStaticProps({ preview = null }) {
const posts = (await getAllPostsForHome(preview)) || [] const allPosts = (await getAllPostsForHome(preview)) || []
return { return {
props: { posts, preview }, props: { allPosts, preview },
} }
} }
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import ErrorPage from 'next/error' import ErrorPage from 'next/error'
import Container from 'components/container' import Container from '@/components/container'
import PostBody from 'components/post-body' import PostBody from '@/components/post-body'
import MoreStories from 'components/more-stories' import MoreStories from '@/components/more-stories'
import Header from 'components/header' import Header from '@/components/header'
import PostHeader from 'components/post-header' import PostHeader from '@/components/post-header'
import SectionSeparator from 'components/section-separator' import SectionSeparator from '@/components/section-separator'
import Layout from 'components/layout' import Layout from '@/components/layout'
import { getAllPostsWithSlug, getPostAndMorePosts } from 'lib/preprio' import { getAllPostsWithSlug, getPostAndMorePosts } from '@/lib/api'
import PostTitle from 'components/post-title' import PostTitle from '@/components/post-title'
import Head from 'next/head' import Head from 'next/head'
import { CMS_NAME } from 'lib/constants' import { CMS_NAME } from '@/lib/constants'
export default function Post({ post, morePosts, preview }) { export default function Post({ post, morePosts, preview }) {
const router = useRouter() const router = useRouter()
if (!router.isFallback && !post?._slug) { if (!router.isFallback && !post?._slug) {
return <ErrorPage statusCode={404} /> return <ErrorPage statusCode={404} />
} }
return ( return (
<Layout preview={preview}> <Layout preview={preview}>
<Container> <Container>
...@@ -30,15 +28,15 @@ export default function Post({ post, morePosts, preview }) { ...@@ -30,15 +28,15 @@ export default function Post({ post, morePosts, preview }) {
<article> <article>
<Head> <Head>
<title> <title>
{`${post.title} | Next.js Blog Example with ${CMS_NAME}`} {post.title} | Next.js Blog Example with {CMS_NAME}
</title> </title>
{/* <meta property="og:image" content={post.ogImage.url} /> */} <meta property="og:image" content={post.cover[0].url} />
</Head> </Head>
<PostHeader <PostHeader
title={post.title} title={post.title}
coverImage={post.cover[0].cdn_files[0].url} coverImage={post.cover[0].url}
date={post.date} date={post._publish_on}
author={post.author[0]} author={post.authors[0]}
/> />
<PostBody content={post.content} /> <PostBody content={post.content} />
</article> </article>
...@@ -52,24 +50,26 @@ export default function Post({ post, morePosts, preview }) { ...@@ -52,24 +50,26 @@ export default function Post({ post, morePosts, preview }) {
} }
export async function getStaticProps({ params, preview = false }) { export async function getStaticProps({ params, preview = false }) {
const data = await getPostAndMorePosts(params.slug, preview) const { post, morePosts } = await getPostAndMorePosts(params.slug, preview)
return { return {
props: { props: {
preview, preview,
post: data.Post, post,
morePosts: data.morePosts.items || [], morePosts,
}, },
} }
} }
export async function getStaticPaths() { export async function getStaticPaths() {
const posts = await getAllPostsWithSlug() const allPosts = await getAllPostsWithSlug()
const paths = allPosts.map((post) => ({
params: { slug: post._slug },
}))
return { return {
paths: posts.map(({ slug }) => ({ paths,
params: { slug },
})),
fallback: true, fallback: true,
} }
} }
/* purgecss start ignore */
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
/* purgecss end ignore */
@tailwind utilities; @tailwind utilities;
@layer components {
.article h2 {
@apply mb-5 text-4xl font-bold leading-tight;
}
.article p,
.article ul,
.article ol {
@apply mb-5;
}
.article ol {
@apply ml-5 list-decimal list-outside;
}
.article ul {
@apply ml-5 list-disc list-outside;
}
.article a {
@apply underline;
}
.article ol li {
@apply mb-4;
}
}
...@@ -14,23 +14,28 @@ Once you have access to [the environment variables you'll need](#step-5-set-up-e ...@@ -14,23 +14,28 @@ Once you have access to [the environment variables you'll need](#step-5-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -15,24 +15,28 @@ You'll get: ...@@ -15,24 +15,28 @@ You'll get:
## Related examples ## Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [TakeShape](/examples/cms-takeshape) - [ButterCMS](/examples/cms-buttercms)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
# Configuration # Configuration
......
...@@ -15,22 +15,28 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu ...@@ -15,22 +15,28 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms) - [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent) - [Kontent](/examples/cms-kontent-ai)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore) - [Prepr](/examples/cms-prepr)
- [Builder.io](/examples/cms-builder-io) - [Prismic](/examples/cms-prismic)
- [TinaCMS](/examples/cms-tina/) - [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-6-set-up-e ...@@ -14,24 +14,28 @@ Once you have access to [the environment variables you'll need](#step-6-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [Strapi](/examples/cms-strapi) - [DatoCMS](/examples/cms-datocms)
- [ButterCMS](/examples/cms-buttercms)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,23 +14,28 @@ Once you have access to [the environment variables you'll need](#step-5-set-up-e ...@@ -14,23 +14,28 @@ Once you have access to [the environment variables you'll need](#step-5-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -15,23 +15,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e ...@@ -15,23 +15,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent)
- [Ghost](/examples/cms-ghost)
- [Blog Starter](/examples/blog-starter)
- [DotCMS](/examples/cms-dotcms) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,21 +14,28 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu ...@@ -14,21 +14,28 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
### Related examples ### Related examples
- [WordPress](/examples/cms-wordpress) - [AgilityCMS](/examples/cms-agilitycms)
- [DatoCMS](/examples/cms-datocms) - [Builder.io](/examples/cms-builder-io)
- [Sanity](/examples/cms-sanity) - [ButterCMS](/examples/cms-buttercms)
- [TakeShape](/examples/cms-takeshape)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok) - [DotCMS](/examples/cms-dotcms)
- [Drupal](/examples/cms-drupal)
- [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms) - [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent) - [Kontent](/examples/cms-kontent-ai)
- [Umbraco Heartcore](/examples/cms-umbraco-heartcore) - [Prepr](/examples/cms-prepr)
- [Builder.io](/examples/cms-builder-io) - [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter)
- [WordPress](/examples/cms-wordpress)
## How to use ## How to use
......
...@@ -14,22 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e ...@@ -14,22 +14,28 @@ Once you have access to [the environment variables you'll need](#step-3-set-up-e
### Related examples ### Related examples
- [DatoCMS](/examples/cms-datocms) - [AgilityCMS](/examples/cms-agilitycms)
- [Sanity](/examples/cms-sanity) - [Builder.io](/examples/cms-builder-io)
- [TakeShape](/examples/cms-takeshape) - [ButterCMS](/examples/cms-buttercms)
- [Prismic](/examples/cms-prismic)
- [Contentful](/examples/cms-contentful) - [Contentful](/examples/cms-contentful)
- [Strapi](/examples/cms-strapi)
- [Agility CMS](/examples/cms-agilitycms)
- [Cosmic](/examples/cms-cosmic) - [Cosmic](/examples/cms-cosmic)
- [ButterCMS](/examples/cms-buttercms) - [DatoCMS](/examples/cms-datocms)
- [Storyblok](/examples/cms-storyblok) - [DotCMS](/examples/cms-dotcms)
- [GraphCMS](/examples/cms-graphcms) - [Drupal](/examples/cms-drupal)
- [Kontent](/examples/cms-kontent) - [Enterspeed](/examples/cms-enterspeed)
- [Ghost](/examples/cms-ghost) - [Ghost](/examples/cms-ghost)
- [GraphCMS](/examples/cms-graphcms)
- [Kontent](/examples/cms-kontent-ai)
- [Prepr](/examples/cms-prepr)
- [Prismic](/examples/cms-prismic)
- [Sanity](/examples/cms-sanity)
- [Sitefinity](/examples/cms-sitefinity)
- [Storyblok](/examples/cms-storyblok)
- [TakeShape](/examples/cms-takeshape)
- [Umbraco heartcore](/examples/cms-umbraco-heartcore)
- [Webiny](/examples/cms-webiny)
- [Blog Starter](/examples/blog-starter) - [Blog Starter](/examples/blog-starter)
- [Builder.io](/examples/cms-builder-io) - [WordPress](/examples/cms-wordpress)
- [DotCMS](/examples/cms-dotcms)
## How to use ## How to use
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment