{"id":14962955,"url":"https://github.com/tryghost/gatsby-source-ghost","last_synced_at":"2025-05-15T16:07:58.962Z","repository":{"id":32927195,"uuid":"145133007","full_name":"TryGhost/gatsby-source-ghost","owner":"TryGhost","description":" Source plugin for pulling data into Gatsby.js from the Ghost Public API.","archived":false,"fork":false,"pushed_at":"2025-01-07T14:03:27.000Z","size":736,"stargazers_count":178,"open_issues_count":12,"forks_count":44,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-15T09:27:38.795Z","etag":null,"topics":["gatsby","gatsby-source","gatsbyjs","ghost"],"latest_commit_sha":null,"homepage":"https://ghost.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TryGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"tryghost","open_collective":"ghost"}},"created_at":"2018-08-17T14:50:40.000Z","updated_at":"2025-04-04T03:42:40.000Z","dependencies_parsed_at":"2024-11-06T06:36:15.382Z","dependency_job_id":"1ea81329-b3e1-411d-91fd-d3ce840e736c","html_url":"https://github.com/TryGhost/gatsby-source-ghost","commit_stats":{"total_commits":348,"total_committers":21,"mean_commits":"16.571428571428573","dds":0.5,"last_synced_commit":"1d16ecacdbd917c2c437c3bd90652084310f5b5c"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-source-ghost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-source-ghost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-source-ghost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-source-ghost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TryGhost","download_url":"https://codeload.github.com/TryGhost/gatsby-source-ghost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374475,"owners_count":22060611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatsby","gatsby-source","gatsbyjs","ghost"],"created_at":"2024-09-24T13:30:49.152Z","updated_at":"2025-05-15T16:07:58.874Z","avatar_url":"https://github.com/TryGhost.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tryghost","https://opencollective.com/ghost"],"categories":[],"sub_categories":[],"readme":"# Gatsby Source Ghost\n\nSource plugin for pulling data into [Gatsby.js](https://www.gatsbyjs.org/) from [Ghost](https://ghost.org), using the Ghost [Content API](https://docs.ghost.org/api/content/).\n\n* **Demo:** https://gatsby.ghost.org\n* **Gatsby Starter** https://github.com/TryGhost/gatsby-starter-ghost\n* **Documentation:** https://docs.ghost.org/api/gatsby/\n\n\n## Install\n\n`yarn add gatsby-source-ghost`\n\n`npm install --save gatsby-source-ghost`\n\n## How to use\n\nPlugin configuration for `gatsby-config.js`:\n\n```\n{\n   resolve: `gatsby-source-ghost`,\n   options: {\n       apiUrl: `https://\u003cyour-subdomain\u003e.ghost.io`,\n       contentApiKey: `\u003cyour content api key\u003e`,\n       version: `v5.0` // Ghost API version, optional, defaults to \"v5.0\".\n                     // Pass in \"v4.0\" if your Ghost install is not on 5.0 yet!!!\n   }\n}\n```\n\n`apiUrl`\n 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.\n\n`contentApiKey`\nThe \"Content API Key\" copied from the \"Integrations\" screen in Ghost Admin.\n\nIf you want to keep these values private (if your site is not public) you can do so using [environment variables](https://www.gatsbyjs.org/docs/environment-variables/).\n\n## How to query\n\nThere are 5 node types available from Ghost: Post, Page, Author, Tag, and Settings.\n\nDocumentation for the full set of fields made available for each resource type can be\nfound in the [Content API docs](https://docs.ghost.org/api/content/). Posts and Pages have the same properties.\n\n**Example Post Query**\n\n```\n{\n  allGhostPost(sort: { order: DESC, fields: [published_at] }) {\n    edges {\n      node {\n        id\n        slug\n        title\n        html\n        published_at\n        ...\n        tags {\n          id\n          slug\n          ...\n        }\n        primary_tag {\n          id\n          slug\n          ...\n        }\n        authors {\n          id\n          slug\n          ...\n        }\n      }\n    }\n  }\n}\n```\n\n**Filter Posts by Tag**\n\nA common but tricky example of filtering posts by tag, can be achieved like this (Gatsby v2+):\n\n```\n{\n  allGhostPost(filter: {tags: {elemMatch: {slug: {eq: $slug}}}}) {\n    edges {\n      node {\n        slug\n        ...\n      }\n    }\n  }\n}\n```\n\n**Query Settings**\n\nThe settings node is different as there's only one object, and it has the properties [listed here](https://docs.ghost.org/api/content/#settings).\n\n```\n{\n  allGhostSettings {\n    edges {\n      node {\n        title\n        description\n        lang\n        ...\n        navigation {\n            label\n            url\n        }\n      }\n    }\n  }\n}\n```\n\n**Query Other Node Types**\n\nThe Post, Page, Author and Tag nodes all work the same. Use the node type you need in this query:\n\n\n```\n{\n  allGhost${NodeType} {\n    edges {\n      node {\n        id\n        slug\n        ...\n      }\n    }\n  }\n}\n```\n\n\n\n# Copyright \u0026 License\n\nCopyright (c) 2013-2025 Ghost Foundation - Released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryghost%2Fgatsby-source-ghost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftryghost%2Fgatsby-source-ghost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftryghost%2Fgatsby-source-ghost/lists"}