All Projects → TryGhost → Gatsby Source Ghost

TryGhost / Gatsby Source Ghost

Licence: mit
Source plugin for pulling data into Gatsby.js from the Ghost Public API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gatsby Source Ghost

Gatsby Theme Try Ghost
A Gatsby theme to build flaring fast blogs from headless Ghost CMS
Stars: ✭ 88 (-38.89%)
Mutual labels:  gatsby, gatsbyjs, ghost
gatsby-ghost-novela-starter
A Gatsby starter for creating blogs from headless Ghost CMS.
Stars: ✭ 31 (-78.47%)
Mutual labels:  gatsby, ghost, gatsbyjs
gatsby-attila-theme-ghost
A Gatsby theme plugin for creating blogs from headless Ghost CMS.
Stars: ✭ 16 (-88.89%)
Mutual labels:  gatsby, ghost, gatsbyjs
Gatsby Starter Ghost
A starter template to build lightning fast websites with Ghost & Gatsby
Stars: ✭ 752 (+422.22%)
Mutual labels:  gatsby, gatsbyjs, ghost
Gatsby Starter Try Ghost
Publish flaring fast blogs with Gatsby and Ghost
Stars: ✭ 137 (-4.86%)
Mutual labels:  gatsby, gatsbyjs, ghost
Gatsby Ghost Balsa Starter
A Gatsby starter for creating blogs from headless Ghost CMS.
Stars: ✭ 17 (-88.19%)
Mutual labels:  gatsby, gatsbyjs, ghost
Gatsby Shopify Theme
🛒 Simple theme to build a blazing simple and fast store with Gatsby and Shopify.
Stars: ✭ 95 (-34.03%)
Mutual labels:  gatsby, gatsbyjs
Aaronvandenberg.nl
⚛️ Web Developers portfolio build with Gatsby.js & React.js
Stars: ✭ 98 (-31.94%)
Mutual labels:  gatsby, gatsbyjs
Rbb Website
Website to help connect black-owned businesses with consumers and resources
Stars: ✭ 101 (-29.86%)
Mutual labels:  gatsby, gatsbyjs
Gabriel Adorf Portfolio
Gabriel Adorf's personal website
Stars: ✭ 133 (-7.64%)
Mutual labels:  gatsby, gatsbyjs
Gatsby With Unstructured Data
A simple example of creating pages dynamically in Gatsby without using GraphQL.
Stars: ✭ 83 (-42.36%)
Mutual labels:  gatsby, gatsbyjs
Gatsby Theme Chronoblog
⏳ Chronoblog is a Gatsbyjs theme specifically designed to create a personal website. The main idea of ​​Chronoblog is to allow you not only to write a personal blog but also to keep a record of everything important that you have done.
Stars: ✭ 101 (-29.86%)
Mutual labels:  gatsby, gatsbyjs
Nodejs.dev
A new Node.js resource built using Gatsby.js with React.js, TypeScript, and Remark.
Stars: ✭ 1,794 (+1145.83%)
Mutual labels:  gatsby, gatsbyjs
Gatsby Plugin Advanced Sitemap
Advanced XML Sitemaps for Gatsby.js
Stars: ✭ 94 (-34.72%)
Mutual labels:  gatsby, gatsbyjs
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 (-6.25%)
Mutual labels:  gatsby, gatsbyjs
Blog
Source for my blazing fast blog
Stars: ✭ 83 (-42.36%)
Mutual labels:  gatsby, gatsbyjs
Gatsbytutorials.com
A community-updated list of video, audio and written tutorials to help you learn GatsbyJS. 👩‍💻
Stars: ✭ 109 (-24.31%)
Mutual labels:  gatsby, gatsbyjs
Gatsby Source Datocms
Official GatsbyJS source plugin to pull content from DatoCMS
Stars: ✭ 113 (-21.53%)
Mutual labels:  gatsby, gatsbyjs
Gatsby London
A free, open source, image-concentric starter for GatsbyJS
Stars: ✭ 137 (-4.86%)
Mutual labels:  gatsby, ghost
Gatsby Plugin Mailchimp
A simple, lightweight Gatsby plugin to subscribe new email addresses to your Mailchimp list
Stars: ✭ 125 (-13.19%)
Mutual labels:  gatsby, gatsbyjs

Gatsby Source Ghost

Source plugin for pulling data into Gatsby.js from Ghost, using the Ghost Content API.

Install

yarn add gatsby-source-ghost

npm install --save gatsby-source-ghost

How to use

Plugin configuration for gatsby-config.js:

{
   resolve: `gatsby-source-ghost`,
   options: {
       apiUrl: `https://<your-subdomain>.ghost.io`,
       contentApiKey: `<your content api key>`,
       version: `v3` // Ghost API version, optional, defaults to "v3".
                     // Pass in "v2" if your Ghost install is not on 3.0 yet!!!
   }
}

apiUrl Ghost Content API URL - for Ghost(Pro) customers this is your .ghost.io domain, it’s the same URL used to view the admin panel, but without the /ghost subdirectory. This should be served over https.

contentApiKey The "Content API Key" copied from the "Integrations" screen in Ghost Admin.

If you want to keep these values private (if your site is not public) you can do so using environment variables.

How to query

There are 5 node types available from Ghost: Post, Page, Author, Tag, and Settings.

Documentation for the full set of fields made available for each resource type can be found in the Content API docs. Posts and Pages have the same properties.

Example Post Query

{
  allGhostPost(sort: { order: DESC, fields: [published_at] }) {
    edges {
      node {
        id
        slug
        title
        html
        published_at
        ...
        tags {
          id
          slug
          ...
        }
        primary_tag {
          id
          slug
          ...
        }
        authors {
          id
          slug
          ...
        }
      }
    }
  }
}

Filter Posts by Tag

A common but tricky example of filtering posts by tag, can be achieved like this (Gatsby v2+):

{
  allGhostPost(filter: {tags: {elemMatch: {slug: {eq: $slug}}}}) {
    edges {
      node {
        slug
        ...
      }
    }
  }
}

Query Settings

The settings node is different as there's only one object, and it has the properties listed here.

{
  allGhostSettings {
    edges {
      node {
        title
        description
        lang
        ...
        navigation {
            label
            url
        }
      }
    }
  }
}

Query Other Node Types

The Post, Page, Author and Tag nodes all work the same. Use the node type you need in this query:

{
  allGhost${NodeType} {
    edges {
      node {
        id
        slug
        ...
      }
    }
  }
}

Copyright & License

Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license.

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].