Gatsby-blog-cosmicjs - 🚀⚡️ Blazing fast blog built with Gatsby and the Cosmic Headless CMS 🔥

Overview

Gatsby + Cosmic

gatsby-blog-cosmicjs

This repo contains an example blog website that is built with Gatsby, and Cosmic.

See live demo hosted on Netlify

Uses the Cosmic Gatsby Source Plugin

Prerequisites

  • Node (I recommend using v8.2.0 or higher)
  • Gatsby CLI

Install

# Make sure that you have the Gatsby CLI program installed
npm install --global gatsby-cli

# run from your CLI
gatsby new gatsby-example-blog https://github.com/cosmicjs/gatsby-blog-cosmicjs

In gatsby-config.js you need to add configuration for your Cosmic Bucket

{
  resolve: 'gatsby-source-cosmicjs',
  options: {
    bucketSlug: '', /* Find this in Your Bucket > Settings > Basic Settings after logging in at https://app.cosmicjs.com/login */
    objectTypes: ['posts', 'settings'], /* Object types to fetch */
    apiAccess: {
      read_key: '', /* Find this in Your Bucket > Settings > API Access after logging in at https://app.cosmicjs.com/login */
    },
    localMedia: true /* Optional. If you want to enable local image for Gatsby Image */
  }
},

Then

# Then you can run it by
cd gatsby-example-blog
npm run develop

Enable content auto refresh

To enable content auto refresh, open another terminal window and run the following command:

npm run poll-content

This will poll the content in your Bucket for any updates and automatically refresh it in your blog during development. Learn more about refreshing content in the Gatsby docs.

Deploy to Netlify

You can deploy to Netlify in a few steps using their CLI. Run the following commands from the root folder.

npm i -g netlify-cli
netlify deploy

Set your Environment Variables in Netlify

In the Netlify dashboard, set your environment variables located in Site Settings > Build and Deploy > Environment. Find your Cosmic Bucket keys located in Bucket > Basic Settings after logging in.

COSMIC_BUCKET=<your-bucket-slug>
COSMIC_READ_KEY=<your-bucket-read-key>
You might also like...

⚡️A minimalistic and sweet router for blazing fast bun

⚡️A minimalistic and sweet router for blazing fast bun

Melonpan is a simple and minimalistic web-router designed to work with Bun, keeping performance in mind. 🤔 Why Melonpan? no/minimal learning curve De

Jan 6, 2023

🚀 Blazing Fast S3 Powered CDN ✨ Powered By Fastify, S3 Buckets & Docker!

🚀 WasiCDN Blazing Fast S3 Powered CDN, Powered By Fastify, S3 Compatible Buckets & Docker! Core DockerHub: https://hub.docker.com/r/maximking19/wasic

Aug 31, 2022

Blazing fast 🔥 Discord Desktop Client.

Fastcord Faster Discord Desktop Client Made with Rust & React Motivation Discord is cool but electron is not. Discord Desktop consumes too much memory

Nov 21, 2022

⚡ Take a snapshot of all NFT/ERC721 collection holders. Blazing fast ⚡

⚡ Instant NFT / ERC721 Snapshot This small command line tool let's you create a blazing fast snapshot of all the owners of a NFT collection. For a 10k

Dec 4, 2022

Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics.

Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.

Jan 29, 2022

Um website completo desenvolvido com Next SSR, Typescript, Prismic CMS do tipo blog com diversas funcionalidades para interações entre os usuários.

Um website completo desenvolvido com Next SSR, Typescript, Prismic CMS do tipo blog com diversas funcionalidades para interações entre os usuários.

Título: Spacetraveling Descrição: Um website completo desenvolvido com Next SSR, Typescript, Prismic CMS do tipo blog com diversas funcionalidades par

Dec 21, 2022

Build a blog site using Nextjs, Tailwind css, GraphQL, Graph CMS

Build a blog site using Nextjs, Tailwind css, GraphQL, Graph CMS

NextJs-GraphQL-blog-site 1. Key Features 2. Technologies I've used Key Features: 🟢 In Graph-CMS side we can create post, categories, check the commen

Dec 8, 2022

Simple, Fast, Secure, Flat-File CMS

Bludit Simple, Fast and Flexible CMS. Bludit is a web application to build your own website or blog in seconds, it's completely free and open source.

Dec 30, 2022

A new Node.js resource built using Gatsby.js with React.js, TypeScript, and Remark.

Nodejs.dev Nodejs.dev site built using Gatsby.js with React.js, TypeScript, SCSS, and Remark. You can find the latest Figma design protype here. 🚀 Ge

Jan 5, 2023
Owner
Priya Chakraborty
Currently pursuing Btech in Electrical Engineering from SIT
Priya Chakraborty
A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email.

Strapi PasswordLess Plugin A plugin for Strapi Headless CMS that provides ability to sign-in/sign-up to an application by link had sent to email. A pl

Andrey Kucherenko 51 Dec 12, 2022
A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.

strapi-plugin-transformer A plugin for Strapi that provides the ability to transform the API request and/or response. Requirements The installation re

daedalus 71 Jan 6, 2023
Update & Revalidate Content from a Headless CMS in Next.js with Incremental Static Regeneration

Update & Revalidate Content from a Headless CMS in Next.js with Incremental Static Regeneration Demo for tutorial How to Update & Revalidate Content f

Colby Fayock 4 Jul 22, 2022
🛠 Building a Headless CMS with all the essential features for business representative websites to make 🚀

Isomera - headless CMS for business representative websites SaaS that is hosted on the cloud and built by community. To make developer life easy. ⚠️ A

Cortip 8 Dec 3, 2022
simple-remix-blog is a blog template built using Remix and TailwindCSS. Create your own blog in just a few minutes!

simple-remix-blog is a blog template built using remix.run and TailwindCSS. It supports markdown and MDX for the blog posts. You can clone it and star

José Miguel Álvarez Vañó 8 Dec 8, 2022
Stablo is a minimal blog website template built with Next.js, TailwindCSS & Sanity CMS

Stablo Blog Template - Next.js & Sanity CMS Stablo is a JAMStack Starter template built with Next.js, Tailwind CSS & Sanity CMS by Web3Templates. Clic

Web3Templates 159 Dec 30, 2022
⚡ A blazing fast, lightweight, and open source comment system for your static website, blogs powered by Supabase

SupaComments ⚡ A blazing fast, lightweight, and open source comment system for your static website, blogs ?? Demo You can visit the Below demo blog po

MC Naveen 112 Dec 27, 2022
An open-source, blazing fast code editor for Windows, Mac, and Linux.

Thermite An open-source, blazing fast code editor for Windows, Mac, and Linux. About Thermite is a Blazing Fast, Open-Source, Cross-Platform Code Edit

Keston 4 Oct 25, 2022
🔥 Blazing Fast API which scrapes Mydramalist.com made using Fastify and Cheerio.

mydramalist API ?? Blazing Fast API which scrapes Mydramalist.com made using Fastify and Cheerio. Setup pnpm install node index.js available at http:/

Paranjay Singh 6 Dec 4, 2022
Blazing fast and lightweight state management framework 👓

StateX is a blazing fast and lightweight framework for managing state in a Javascript app. Features ?? Fast − Our APIs just run lightning fast, no mor

Truelines 7 Oct 8, 2022