Socket
Socket
Sign inDemoInstall

gatsby-source-ghost

Package Overview
Dependencies
Maintainers
11
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-source-ghost - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

6

gatsby-node.js
const GhostContentAPI = require('@tryghost/content-api');
const Promise = require('bluebird');
const {PostNode, PageNode, TagNode, AuthorNode} = require('./nodes');
const {PostNode, PageNode, TagNode, AuthorNode, SettingsNode} = require('./nodes');

@@ -46,3 +46,5 @@ exports.sourceNodes = ({boundActionCreators}, configOptions) => {

return Promise.all([fetchPosts, fetchPages, fetchTags, fetchAuthors]);
const fetchSettings = api.settings.browse().then(setting => createNode(SettingsNode(setting)));
return Promise.all([fetchPosts, fetchPages, fetchTags, fetchAuthors, fetchSettings]);
};

@@ -13,2 +13,3 @@ const createNodeHelpers = require('gatsby-node-helpers').default;

const AUTHOR = 'Author';
const SETTINGS = 'Settings';

@@ -19,1 +20,2 @@ module.exports.PostNode = createNodeFactory(POST);

module.exports.AuthorNode = createNodeFactory(AUTHOR);
module.exports.SettingsNode = createNodeFactory(SETTINGS);
{
"name": "gatsby-source-ghost",
"version": "3.0.0",
"version": "3.1.0",
"description": "Gatsby source plugin for building websites using the Ghost API as a data source.",

@@ -5,0 +5,0 @@ "repository": "git@github.com:TryGhost/gatsby-plugin-ghost.git",

@@ -76,3 +76,3 @@ # Gatsby Source Ghost

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

@@ -79,0 +79,0 @@ node {

@@ -36,2 +36,9 @@ // Switch these lines once there are useful utils

]);
const browseSettings = sinon.stub().resolves(
{
title: 'Ghost & Gatsby',
description: 'Thoughts, stories and ideas.',
navigation: [{label: 'Home', url: '/'}]
}
);
const GhostContentApiStub = function () {

@@ -42,3 +49,4 @@ return {

tags: {browse: browseTags},
authors: {browse: browseAuthors}
authors: {browse: browseAuthors},
settings: {browse: browseSettings}
};

@@ -52,3 +60,3 @@ };

.then(() => {
createNode.callCount.should.eql(6);
createNode.callCount.should.eql(7);

@@ -64,2 +72,3 @@ const getArg = call => createNode.getCall(call).args[0];

getArg(5).internal.should.have.property('type', 'GhostAuthor');
getArg(6).internal.should.have.property('type', 'GhostSettings');

@@ -66,0 +75,0 @@ done();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc