forked from TryGhost/gatsby-source-ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨🐛 Fixed unexpected null/undefined fields
closes #2 - This is the hacky workaround recommended by Gatsby - Ref: gatsbyjs/gatsby#10856 (comment) - It depends on private API, but is better than needing a data stub!
- Loading branch information
Showing
5 changed files
with
234 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
const tag = { | ||
id: 'a6fd74f5667245d9b678429bc35febbf', | ||
name: 'Data schema primary', | ||
slug: 'data-schema', | ||
url: 'https://demo.ghost.io/tag/data-schema-tag/', | ||
description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
feature_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
visibility: 'public', | ||
meta_title: 'Data schema primary', | ||
meta_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
count: {posts: 1} | ||
}; | ||
const author = { | ||
id: '179e06da7ae846929bb30f19f3e82ecb', | ||
name: 'Data Schema Author', | ||
slug: 'data-schema-author', | ||
url: 'https://demo.ghost.io/author/data-schema-author/', | ||
profile_image: 'https://casper.ghost.org/v2.0.0/images/ghost.png', | ||
cover_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
bio: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
website: 'https://ghost.org', | ||
location: 'The Internet', | ||
facebook: 'ghost', | ||
twitter: '@tryghost', | ||
meta_title: 'Data Schema Author', | ||
meta_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
count: {posts: 1} | ||
}; | ||
|
||
const post = { | ||
id: '5bbafb3cb7ec4135e42fce56', | ||
uuid: '472cd89d-953c-42ad-ae18-974b35444d03', | ||
title: 'Data schema', | ||
slug: 'data-schema', | ||
url: 'https://demo.ghost.io/data-schema/', | ||
mobiledoc: '{"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function"]]]]}', | ||
html: '<p>This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function</p>', | ||
comment_id: '5bb75b5a37361dae192eff1b', | ||
plaintext: 'This is a data schema stub for Gatsby.js and is not used. It must exist for\nbuilds to function', | ||
feature_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
featured: true, | ||
page: false, | ||
meta_title: 'Data schema', | ||
meta_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
created_at: '2018-12-04T13:59:08.000+00:00', | ||
updated_at: '2018-12-04T13:59:08.000+00:00', | ||
published_at: '2018-12-04T13:59:14.000+00:00', | ||
custom_excerpt: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
excerpt: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
codeinjection_head: '.some-class {\n}', | ||
codeinjection_foot: '.some-class {\n}', | ||
og_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
og_title: 'Data schema', | ||
og_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
twitter_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
twitter_title: 'Data schema', | ||
twitter_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
primary_author: author, | ||
primary_tag: tag, | ||
authors: [author], | ||
tags: [tag] | ||
}; | ||
const page = { | ||
id: '5bbafb3cb7ec4135e42fce57', | ||
uuid: '472cd89d-953c-42ad-ae18-974b35444d04', | ||
title: 'Data schema', | ||
slug: 'data-schema-page', | ||
url: 'https://demo.ghost.io/data-schema-page/', | ||
mobiledoc: '{"version":"0.3.1","atoms":[],"cards":[],"markups":[],"sections":[[1,"p",[[0,[],0,"This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function"]]]]}', | ||
html: '<p>This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function</p>', | ||
comment_id: '5bb75b5a37361dae192eff1b', | ||
plaintext: 'This is a data schema stub for Gatsby.js and is not used. It must exist for\nbuilds to function', | ||
feature_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
featured: false, | ||
page: true, | ||
meta_title: 'Data schema', | ||
meta_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
created_at: '2018-12-04T13:59:08.000+00:00', | ||
updated_at: '2018-12-04T13:59:08.000+00:00', | ||
published_at: '2018-12-04T13:59:14.000+00:00', | ||
custom_excerpt: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
excerpt: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
codeinjection_head: '.some-class {\n}', | ||
codeinjection_foot: '.some-class {\n}', | ||
og_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
og_title: 'Data schema', | ||
og_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
twitter_image: 'https://images.unsplash.com/photo-1532630571098-79a3d222b00d?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ&s=a88235003c40468403f936719134519d', | ||
twitter_title: 'Data schema', | ||
twitter_description: 'This is a data schema stub for Gatsby.js and is not used. It must exist for builds to function', | ||
custom_template: 'post.hbs', | ||
primary_author: author, | ||
primary_tag: tag, | ||
authors: [author], | ||
tags: [tag] | ||
}; | ||
|
||
const settings = { | ||
title: 'Ghost', | ||
description: 'The professional publishing platform', | ||
logo: 'https://static.ghost.org/v1.0.0/images/ghost-logo.svg', | ||
icon: 'https://static.ghost.org/favicon.ico', | ||
cover_image: 'https://static.ghost.org/v1.0.0/images/blog-cover.jpg', | ||
facebook: 'ghost', | ||
twitter: 'tryghost', | ||
lang: 'en', | ||
timezone: 'Etc/UTC', | ||
ghost_head: '<script></script>', | ||
ghost_foot: '<style></style>', | ||
navigation: [ | ||
{label: 'Home', url: '/'}, | ||
{label: 'Tag', url: '/tag/getting-started/'}, | ||
{label: 'Author', url: '/author/ghost/'}, | ||
{label: 'Help', url: 'https://help.ghost.org'} | ||
] | ||
}; | ||
|
||
module.exports = { | ||
post, | ||
page, | ||
tag, | ||
author, | ||
settings | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters