Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

SenseNet/gatsby-starter-sensenet-blog

Repository files navigation

sn-blog-gatsby

This example demonstrates how to create an app with sensenet and Gatsby using sensenet source plugin. It's a good starter for building a blog sourcing data from sensenet.

Quick start

gatsby new sensenet-starter https://github.com/SenseNet/gatsby-starter-sensenet-blog

Start developing. Navigate into your new site’s directory and start it up.

cd sensenet-starter
gatsby develop

Features

  • A simple blog built with sensenet
  • Uses typescript
  • Uses gatsby-plugin-material-ui for styling
  • Uses prismjs for code highlighting
  • Uses date-fns for date formatting
  • Uses gatsby-plugin-mdx to process mdx
  • Uses gatsby-plugin-image for image rendering

Configuration

You have to add urls of your sensenet repository and identity server to configuration.js:

exports.repositoryUrl = '<YOUR REPOSITORY URL>'

exports.configuration = {
  clientId: process.env.GATSBY_REACT_APP_CLIENT_ID || '',
  clientSecret: process.env.GATSBY_REACT_APP_CLIENT_SECRET || '',
  identityServerUrl: '<YOUR IDENTITY SERVER URL>',
}

GATSBY_REACT_APP_CLIENT_ID and GATSBY_REACT_APP_CLIENT_SECRET environmental variables should be defined.

You can easily store them in .env files by doing the following:

// In your .env file
GATSBY_REACT_APP_CLIENT_ID=<YOUR CLIENT ID>
GATSBY_REACT_APP_CLIENT_SECRET=<YOUR SECRET>

Where can you get the missing information?

There are two ways to get your client_id and client_secret: You can find them on your snaas user profile or on the admin-ui logged-in to the repository as well. Also here can be found the repository url and url of the identity server.

Deployment

See the official connecting to sensenet guide.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published