Skip to content

KushibikiMashu/next-blog-esa

Repository files navigation

A statically generated blog example using Next.js and esa

This example showcases Next.js's Static Generation feature using esa as the data source.

Demo

Related examples

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

npm init next-app --example cms-esa cms-esa-app
# or
yarn create next-app --example cms-esa cms-esa-app

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/cms-esa
cd cms-esa

Configuration

Step 1. Create an account and a team on esa

First, create an account on esa.

After creating an account, create a new team from the dashboard and assign any name to it.

Step 2. Populate Content

Step 3. Set up environment variables

From the dropdown next to the project name, click API Keys.

Create a new API Key with the Read permission.

Next, copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Then set each variable on .env.local:

  • ESA_API_TOKEN should be the API token you just copied.
  • ESA_TEAM should be the team name, which is a subdomain in the esa URL: https://<team>.esa.io/

Your .env.local file should look like this:

ESA_API_TOKEN=...
ESA_TEAM=...

Step 4. Run Next.js in development mode

npm install
npm run dev

# or

yarn install
yarn dev

Your blog should be up and running on http://localhost:3000! If it doesn't work, post on GitHub discussions.

Step 5. Deploy on Vercel

You can deploy this app to the cloud with Vercel (Documentation).

Deploy Your Local Project

To deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and import to Vercel.

Important: When you import your project on Vercel, make sure to click on Environment Variables and set them to match your .env.local file.

About

A statically generated blog example using Next.js and esa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published