Skip to content

A simple Prismic + Sapper sample site that pulls data from the Prismic Gatsby tutorial repo.

Notifications You must be signed in to change notification settings

briansteeleca/prismic-sapper-gatsby-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extended Simple Sapper & Prismic example site

This example uses levimykel's Simple Sapper & Prismic example site starter, but pulls in content from Prismic's Gatsby Step by Step Tutorial site.

Getting started

To create your new Prismic repository, follow the Launch the project instructions. Once you've installed the Prismic CLI and logged in, you can create your new Prismic repo as follows:

prismic theme https://github.com/prismicio/gatsby-getting-started-tutorial --ignore-conf

If it asks you for the URL of your theme, type:

https://github.com/prismicio/gatsby-getting-started-tutorial

Name your repository and choose the default Local folder to initialize your project. The local folder will contain a Gatsby starter, but since we're using Sapper, you can discard it.

Now download the Sapper project code from this repo.

npx degit briansteeleca/prismic-sapper-gatsby-tutorial my-prismic-app

Now change into the project directory:

cd my-prismic-app

In the root of your project, create a file named.env. Add the environment variable PRISMIC_ENDPOINT equal to your Prismic repo URL. For example, if your new Prismic repo is named 'my-new-prismic-repo', your .env file should look like this:

PRISMIC_ENDPOINT=https://my-new-prismic-repo.prismic.io/api/v2

Then install the dependencies and run the project in development mode with:

npm install
npm run dev

This will a local server at localhost:3000 where you can see the site in action.

Note: Rather than using scoped CSS, this example dumps all of the CSS from Prismic's Gatsby tutorial site in global.css!

About

A simple Prismic + Sapper sample site that pulls data from the Prismic Gatsby tutorial repo.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published