All Projects → sanity-io → Example Company Website Gatsby Sanity Combo

sanity-io / Example Company Website Gatsby Sanity Combo

Licence: mit
This is an example company website using Gatsby and Sanity in combination.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Example Company Website Gatsby Sanity Combo

plasmic
Visual page builder and web design tool for any website or web app tech stack
Stars: ✭ 1,475 (+509.5%)
Mutual labels:  gatsby, jamstack, headless-cms
Gatsby Starter Netlify Cms
Example gatsby + netlify cms project
Stars: ✭ 1,932 (+698.35%)
Mutual labels:  cms, gatsby, jamstack
Ghost
Turn your audience into a business. Publishing, memberships, subscriptions and newsletters.
Stars: ✭ 39,261 (+16123.55%)
Mutual labels:  cms, headless-cms, jamstack
Ghost Cli
CLI Tool for installing & updating Ghost
Stars: ✭ 313 (+29.34%)
Mutual labels:  cms, headless-cms, jamstack
Jamstack Cms
Modern full stack CMS. Built with Gatsby, GraphQL, AWS Amplify, and Serverless technologies.
Stars: ✭ 702 (+190.08%)
Mutual labels:  cms, gatsby, jamstack
Builder
Drag and drop page building using your code components
Stars: ✭ 1,281 (+429.34%)
Mutual labels:  cms, gatsby, headless-cms
Gatsby Starter Kontent Lumen
Lumen is a minimal, lightweight and mobile-first starter for creating blogs using Gatsby and Kentico Kontent.
Stars: ✭ 34 (-85.95%)
Mutual labels:  cms, gatsby, headless-cms
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+17166.94%)
Mutual labels:  cms, headless-cms, jamstack
Shio
✨ :dna: Shio CMS - Model Content, Use GraphQL and Create Site using Javascript with Native Cache and Search.
Stars: ✭ 119 (-50.83%)
Mutual labels:  cms, headless-cms
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+5350.41%)
Mutual labels:  cms, headless-cms
Gatsby Starter Foundation
A starter to launch your blazing fast personal website and a blog, Built with Gatsby and Netlify CMS. Made with ❤ by Stackrole
Stars: ✭ 135 (-44.21%)
Mutual labels:  gatsby, jamstack
Awesome Headless Cms
An awesome list of headless / decoupled CMS resources.
Stars: ✭ 118 (-51.24%)
Mutual labels:  cms, headless-cms
Awesome Jamstack
📔 Curated list of resources: books, videos, articles, speaker decks, tools about using the JAMstack (A modern web development architecture for creating fast, secure and dynamic websites)
Stars: ✭ 115 (-52.48%)
Mutual labels:  headless-cms, jamstack
Gatsby Starter Lumen
A constantly evolving and thoughtful architecture for creating static blogs.
Stars: ✭ 1,797 (+642.56%)
Mutual labels:  gatsby, jamstack
Elepy
Elepy, The Headless Content Management Framework
Stars: ✭ 109 (-54.96%)
Mutual labels:  cms, headless-cms
Payload
Headless CMS and Application Framework built with Node.js, React and MongoDB
Stars: ✭ 154 (-36.36%)
Mutual labels:  cms, headless-cms
Gine Blog
Blog = Gatsby + React + Material-UI + Notion + Netlify
Stars: ✭ 156 (-35.54%)
Mutual labels:  gatsby, jamstack
Meli
Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Stars: ✭ 2,125 (+778.1%)
Mutual labels:  gatsby, jamstack
Forestry.io
Forestry.io website
Stars: ✭ 233 (-3.72%)
Mutual labels:  cms, jamstack
Tipe
🎉 Next Generation API-first CMS for developers. Generate an API-first CMS from a GraphQL schema with offline prototyping and an inline editor
Stars: ✭ 2,157 (+791.32%)
Mutual labels:  cms, headless-cms

A sample company website built with Gatsby & Sanity.io

This examples combines Gatsby site generation with Sanity content management in a neat little company website. Read the blog post and see the getting started video.

Watch a video about the company website built with Gatsby using Sanity.io as a headless CMS

See the example up and running

Features

A company website built with Gatsby

  • 📡 Real-time content preview in development
  • ⏱ Fast & frugal builds
  • 🗃 No accidental missing fields/types
  • 🧰 Full Render Control with Portable Text
  • 📸 gatsby-image support
  • 🔧 Minimal configuration

Sanity Studio with a schema for

  • 🏢 Company info
  • 📃 Pages
  • 👨🏼‍🎨 Projects
  • 👩🏾‍💻 People
  • 📰 Blog posts

Installation

Read the step-by-step blog post.

git clone [email protected]:sanity-io/example-company-website-gatsby-sanity-combo.git
cd example-company-website-gatsby-sanity-combo
npm install

# Install or upgrade the Sanity CLI to
# make sure you are on v0.140.0 or higher
npm install -g @sanity/cli
# Set up Sanity.io account and project (≈ 45s)
npm run init

See the getting started video for a walkthrough of the installation.

Enable Gatsby watch mode for drafts

We have enabled the watch mode in the gatsby-source-sanity plugin, which means that your frontend will automatically update with content changes whenever you publish them. If you want the frontend to show content changes in real time, you must do the following:

  • Go to manage.sanity.io and find your project (or run the command sanity manage in the studio folder)
  • Navigate to Settings->API and scroll down to the Tokens section
  • Add a new token and give it read privileges.
  • Copy the .env-example file to a file called .env in the /web folder
  • Add your new token to the key: SANITY_TOKEN="<token here>"

If you restart the local development server, it will now show unpublished changes from the Studio. Note that the .env file is ignored by Git, because the token gives access to unpublished content in the API.

Usage example

This project demos Sanity.io with Gatsby using our source plugin. It's a good starter for a simple company site, a portfolio site for an agency or a personal blog with an attached portfolio.

We tried to strike a balance between a useful example and a minimal footprint to make it easier to iterate on design and content model. Let us know should you have questions!

Development setup

Run it

npm start
# Studio at http://localhost:3333
# Web frontend at http://localhost:8000
# GraphiQL explorer at http://localhost:8000/___graphql

Development workflow

We wrote a blog post about how to use this example, but if you would like to just start tinkering:

  • The Sanity Studio keeps its schemas in ./studio/schemas. We will hot reload the editor when you edit them so just start experimenting. Read more about our schemas here.
  • We followed Gatsby conventions and you can read all about them here.
  • If you want Gatsby to not throw errors on missing fields for unpopulated data you need to redeploy the GraphQL API so we can generate schemas – npm run graphql-deploy

Deployment

# Deploy a GraphQL API and schema to Sanity
npm run graphql-deploy

# Deploy the Sanity Studio to *.sanity.studio
npm run sanity-deploy

# Build & deploy to Zeit's Now. Remember to set `basePath` to "/studio" in sanity.json
npm run now-deploy

Deploy on Netlify: If you want to deploy the Gatsby site to Netlify we added a netlify.toml config for you.

Fork or clone the example to your GitHub account. After adding your repo to Netlify you’ll get automatic builds & deploys when pushing to master. You can also add a webhook to get deploys on content changes.

Deploy on Cloudflare: If you want to deploy the Gatsby site to Cloudflare we added a wrangler.toml and workers-site/ to both studio and web.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].