gatsby-source-ghost
Source plugin for pulling data into Gatsby from Ghost.
Install
yarn add gatsby-source-ghost
or npm i --save gatsby-source-ghost
Usage
plugins: [
{
resolve: 'gatsby-source-ghost'
options: {
url: 'http://localhost:2368',
clientId: 'ghost-frontend',
clientSecret: 'secret123'
}
}
]
Querying data
You can query nodes created from Wordpress using GraphQL like the following:
Note: Learn to use the GraphQL tool and Ctrl+Spacebar at
<ghostUrl/___graphiql> to discover the types and properties of your
GraphQL model.
Query posts
{
allGhostBlogPost {
edges {
node {
id
uuid
title
slug
mobiledoc
html
plaintext
amp
feature_image
featured
page
status
locale
visibility
meta_title
meta_description
author_id
created_at
created_by
updated_at
updated_by
published_at
published_by
custom_excerpt
codeinjection_head
codeinjection_foot
og_image
og_title
og_description
twitter_image
twitter_title
twitter_description
authors {
id
name
slug
profile_image
cover_image
bio
website
location
facebook
twitter
accessibility
locale
visibility
meta_title
meta_description
tour
}
tags {
id
name
slug
description
feature_image
visibility
meta_title
meta_description
created_at
created_by
updated_at
updated_by
parent
}
}
}
}
}