Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed now config, added Vercel info in README #20

Merged
merged 2 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 17 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,37 @@
[![Dependency Status](https://david-dm.org/prismicio/nextjs-blog.svg)](https://david-dm.org/prismicio/nextjs-blog)

# Prismic Next.js Blog Site Example
This project is an implementation of the Prismic blog site demo using Next.js. Built up from the starter project, it's meant to provide you with an idea of how to build your own sites using the Prismic features. Read our [user guide](https://user-guides.prismic.io/examples/next-js-samples/sample-blog-with-api-based-cms-in-nextjs) if you need guidance on how to use this repository.

## Getting started quickly with Prismic Themes
You can use our [Prismic-CLI](https://github.com/prismicio/prismic-cli) tool to quickly install this project in your machine, as well as setting up a Prismic repository with the required Custom Types. Just follow the instructions in your terminal to get started!
> [Next.js](https://nextjs.org/) example blog project with content managed in [Prismic](https://prismic.io)

```
npm install -g prismic-cli
prismic theme --theme-url https://github.com/prismicio/nextjs-blog
```
## Check out our article for a step by step guide to getting this project up and running
> [Prismic project guide](https://user-guides.prismic.io/en/articles/2882569-sample-blog-with-api-based-cms-in-next-js)

👆Make sure you update the Prismic endpoint in `prismic-configuration.js`. Especially if you're not fan of soccer.

### Install dependencies
## Install the prismic-cli
```
npm install
npm install -g prismic-cli
```

### Installing Now globally
The official [recommendation](https://zeit.co/guides/updating-now-cli) is to install Now Desktop and check the Canary Releases option. This is will automatically update your now-cli package so it's always up to date. You can also install the package using NPM if you're not concerned about updates.
```
npm install -g now
## Run the theme command
This will create a new Prismic content repository, setup the custom types, and install the project code
```
prismic theme --theme-url https://github.com/prismicio/nextjs-blog

### Run serverless mode locally
As of version 15.0.0 of `now` you can use the `now dev` command to run the project in your local machine in serverless mode. You can use this to set up and test your routing in `now.json` without having to deploy to Now for every small change. Development server will be running in `http:https://localhost:3000/`
```
now dev
```
or
## Run the project
```
npm run dev
```
Then you can access it at [http:https://localhost:3000](http:https://localhost:3000).


## Deploys made easy with Vercel
[Sign up to Vercel](https://vercel.com/login) and follow the [deployment documentation](https://vercel.com/docs/platform/deployments) to quickly deploy your project.

## Deploy to Now 2.0 serverless mode
[Signup for Now](https://zeit.co/now) for deploying your site using serverless features. The required routing and setup files are already included in the project. Just run the `now` command in your project folder if you have installed it, or try the included package.
```
now
```
or
```
npm run deploy
```

## Get started with Prismic
### Learn more about using Prismic with Nextjs

You can find out how to get started with Prismic from [our React documentation](https://prismic.io/docs/reactjs/getting-started/prismic-nextjs).
[Prismic + Next.js documentation](https://prismic.io/docs/reactjs/getting-started/prismic-nextjs).

## License
### License

This software is licensed under the Apache 2 license, quoted below.

Expand Down
2 changes: 1 addition & 1 deletion components/PrismicScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { apiEndpoint } from 'prismic-configuration'
const PrismicScript = () => {
const [, repoName] = apiEndpoint.match(/https?:\/\/([^.]+)?\.(cdn\.)?.+/);
return (
<script async defer src={`//static.cdn.prismic.io/prismic.js?repo=${repoName}&new=true`} />
<script async defer type="text/javascript" src={`"https://static.cdn.prismic.io/prismic.min.js?repo=${repoName}&new=true"`} />
)
}

Expand Down
8 changes: 0 additions & 8 deletions now.json

This file was deleted.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
"devDependencies": {
"now": "^16.6.2"
},
"scripts": {
"dev": "now dev",
"now-build": "next build",
"deploy": "now"
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"repository": {
"type": "git",
Expand Down