From c9db59d3f0173df57d5db9737f4380e19af202ac Mon Sep 17 00:00:00 2001 From: Kevintjuhz Date: Fri, 4 Aug 2023 15:56:44 +0200 Subject: [PATCH] Run prettier on failing files --- examples/cms-prepr/README.md | 23 +++++++++++-------- examples/cms-prepr/components/hero-post.js | 8 ++++--- examples/cms-prepr/components/post-header.js | 8 ++++--- examples/cms-prepr/components/post-preview.js | 8 ++++--- examples/cms-prepr/lib/api.js | 6 ++--- 5 files changed, 31 insertions(+), 22 deletions(-) diff --git a/examples/cms-prepr/README.md b/examples/cms-prepr/README.md index ab96efe05b88..5872f88e40eb 100644 --- a/examples/cms-prepr/README.md +++ b/examples/cms-prepr/README.md @@ -6,8 +6,8 @@ This example showcases Next.js's [Static Generation](https://nextjs.org/docs/bas Check out our Blog page example: -* **Live**: [https://next-blog-prepr.vercel.app/](https://next-blog-prepr.vercel.app/) -* **Preview**: [https://next-blog-prepr.vercel.app/api/preview...](https://next-blog-prepr.vercel.app/api/preview?secret=237864ihasdhj283768&slug=blueberry-cheesecake) +- **Live**: [https://next-blog-prepr.vercel.app/](https://next-blog-prepr.vercel.app/) +- **Preview**: [https://next-blog-prepr.vercel.app/api/preview...](https://next-blog-prepr.vercel.app/api/preview?secret=237864ihasdhj283768&slug=blueberry-cheesecake) ## How to use @@ -55,7 +55,7 @@ The `.env.local` file will be ignored by Git. ![Access tokens](https://assets-site.prepr.io//6jouln4xi3wp-default-access-tokens.png) -Copy the *GraphQL Production* access token and paste it as the `PREPRIO_PRODUCTION_TOKEN` variable in `.env.local`. Then copy and paste the *GraphQL Preview* access token as the `PREPRIO_PREVIEW_TOKEN` variable. +Copy the _GraphQL Production_ access token and paste it as the `PREPRIO_PRODUCTION_TOKEN` variable in `.env.local`. Then copy and paste the _GraphQL Preview_ access token as the `PREPRIO_PREVIEW_TOKEN` variable. Alternatively, you can create access tokens yourself by clicking **Add access token**. If so, make sure to [choose the right GraphQL permissions](https://docs.prepr.io/reference/graphql/v1/authorization) for the access tokens. @@ -83,6 +83,7 @@ npm install ```bash yarn install ``` + **3.2** Execute one of the following commands to run the dev script defined in the `package.json` file: ```bash @@ -102,12 +103,13 @@ Before proceeding, you can test how the content preview works in Prepr. This ste To try preview mode, follow these steps: -**4.1** In Prepr, go to one of the content items of the *Article model* and update the item title. For example, you can add *[PREVIEW]* in front of the title. After you edit the content item, save it with the *Review status*. +**4.1** In Prepr, go to one of the content items of the _Article model_ and update the item title. For example, you can add _[PREVIEW]_ in front of the title. After you edit the content item, save it with the _Review status_. **4.2** To preview the content item, transform its URL to the following format: `http://localhost:3000/api/preview?secret=&slug=`, where: + - `` is the same preview secret you defined in the `.env.local` file; - `` is the slug of the content item you want to preview. @@ -121,12 +123,12 @@ To make your Next.js app available online, deploy it to the cloud using [Vercel] You can go for one of the following options: -* **Deploy your local project**
+- **Deploy your local project**
To deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and [import it to Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example). **Important:** When you import your project on Vercel, make sure to click on **Environment Variables** and set them to match your `.env.local` file. -* **Deploy from our template**
+- **Deploy from our template**
Alternatively, you can deploy using our template by clicking on the **Deploy** button below. [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/cms-prepr&project-name=cms-prepr&repository-name=cms-prepr&env=PREPRIO_API,PREPRIO_PRODUCTION_TOKEN,PREPRIO_PREVIEW_TOKEN,PREPRIO_PREVIEW_SECRET&envDescription=Required%20to%20connect%20the%20app%20with%20Prepr&envLink=https://vercel.link/cms-prepr-env) @@ -134,9 +136,10 @@ You can go for one of the following options: ## Next steps For more advanced topics, please refer to the Prepr’s documentation: -* [A/B testing](https://docs.prepr.io/optimization-and-personalization/ab-testing) -* [Personalization](https://docs.prepr.io/optimization-and-personalization/personalized-stack) -* [Recommendations](https://docs.prepr.io/optimization-and-personalization/recommendations) + +- [A/B testing](https://docs.prepr.io/optimization-and-personalization/ab-testing) +- [Personalization](https://docs.prepr.io/optimization-and-personalization/personalized-stack) +- [Recommendations](https://docs.prepr.io/optimization-and-personalization/recommendations) If you have questions, please [get in touch](https://prepr.io/get-in-touch) with one of our specialists or [join our Slack community](https://slack.prepr.io/). @@ -158,4 +161,4 @@ If you have questions, please [get in touch](https://prepr.io/get-in-touch) with - [GraphCMS](/examples/cms-graphcms) - [Blog Starter](/examples/blog-starter) - [DotCMS](/examples/cms-dotcms) -- [Enterspeed](/examples/cms-enterspeed) \ No newline at end of file +- [Enterspeed](/examples/cms-enterspeed) diff --git a/examples/cms-prepr/components/hero-post.js b/examples/cms-prepr/components/hero-post.js index c24442047baa..6351c2414ad2 100644 --- a/examples/cms-prepr/components/hero-post.js +++ b/examples/cms-prepr/components/hero-post.js @@ -23,9 +23,11 @@ export default function HeroPost({ {title} - {date &&
- -
} + {date && ( +
+ +
+ )}
- {date &&
- -
} + {date && ( +
+ +
+ )}
) diff --git a/examples/cms-prepr/components/post-preview.js b/examples/cms-prepr/components/post-preview.js index dd45cfd760a4..32a307ed31cc 100644 --- a/examples/cms-prepr/components/post-preview.js +++ b/examples/cms-prepr/components/post-preview.js @@ -21,9 +21,11 @@ export default function PostPreview({ {title} - {date &&
- -
} + {date && ( +
+ +
+ )}