GithubHelp home page GithubHelp logo

bace's Introduction

Simple React Blog

Simple React Blog

Now includes revision preview support! See instructions below ⬇️

React + Next.js + GraphQL + Cosmic

This blog uses Next.js to create a Universal React blog. It connects to the Cosmic API via GraphQL. Manage your content from your Cosmic Bucket Dashboard. Simple.

Getting Started

git clone https://github.com/cosmicjs/simple-react-blog
cd simple-react-blog
npm i

Config!

Get your Bucket slug and read key after logging in to Cosmic and going to Bucket > Settings > API Keys.

Run in development

COSMIC_BUCKET=your-bucket-slug COSMIC_READ_KEY=your-bucket-read-key yarn run dev

Run in production

COSMIC_BUCKET=your-bucket-slug COSMIC_READ_KEY=your-bucket-read-key yarn start

Open http://localhost:3000.

Cosmic

You can easily manage the content in your Simple React Blog website on Cosmic. Cosmic makes a great React CMS. Follow these steps:

  1. Log in to Cosmic.
  2. Create a Bucket.
  3. Install the Simple React Blog.
  4. Run locally to preview content edits, or deploy to your favorite hosting provider. Options below.

Deploy

A popular choice for the Next.js framework web deployment is Now. Follow the steps below from the root directiory.

npm i -g now
now

Revision Preview

Follow these steps to add revision preview to your Bucket:

  1. Log in to Cosmic.
  2. Go to Your Simple Blog Bucket > Posts > Settings
  3. Scroll down to the Preview Link section and add the following link:
http://localhost:3000/[object_slug]?revision=[revision_id]
  1. For production, replace http://localhost:3000 with your URL. Now when you "Save as Draft" on any Post, you can preview your changes by clicking the "Preview" link.

bace's People

Contributors

robertjallen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.