{"id":19335688,"url":"https://github.com/buttercms/gatsby-source-buttercms","last_synced_at":"2025-04-23T00:32:08.564Z","repository":{"id":33457056,"uuid":"98355871","full_name":"ButterCMS/gatsby-source-buttercms","owner":"ButterCMS","description":"Gatsby source plugin for building websites using Butter CMS as a data source.","archived":false,"fork":false,"pushed_at":"2023-02-27T17:53:16.000Z","size":1347,"stargazers_count":5,"open_issues_count":0,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-20T23:04:21.850Z","etag":null,"topics":["buttercms","gatsby","gatsby-plugin","graphql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ButterCMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-07-25T22:39:30.000Z","updated_at":"2023-04-05T00:33:48.000Z","dependencies_parsed_at":"2024-06-18T22:52:26.946Z","dependency_job_id":"ea55996d-aabe-435c-a5ef-1500eb2853f9","html_url":"https://github.com/ButterCMS/gatsby-source-buttercms","commit_stats":{"total_commits":87,"total_committers":14,"mean_commits":6.214285714285714,"dds":0.7586206896551724,"last_synced_commit":"d62b7622b8fb6724f59e8d18978269b59dba6cfa"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fgatsby-source-buttercms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fgatsby-source-buttercms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fgatsby-source-buttercms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ButterCMS%2Fgatsby-source-buttercms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ButterCMS","download_url":"https://codeload.github.com/ButterCMS/gatsby-source-buttercms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348327,"owners_count":21415894,"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":["buttercms","gatsby","gatsby-plugin","graphql"],"created_at":"2024-11-10T03:08:31.241Z","updated_at":"2025-04-23T00:32:08.269Z","avatar_url":"https://github.com/ButterCMS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![recommended node version](https://img.shields.io/badge/node-v18-green)\n\n# ButterCMS Gatsby Source Plugin\n\nSource plugin for pulling blog posts, authors, categories, tags, and content fields into [Gatsby](https://www.gatsbyjs.org/) from [ButterCMS](https://buttercms.com/). \n\n*This version (3.0.0) is designed to work with Gatsby 5.0 and above, which only supports node 18 and above. If you want to use our plugin with Gatsby 4, you can use v2.2.6 of this package.*\n\n## Install\n\n`npm install` to install this repo as a standalone, or `npm install --save gatsby-source-buttercms` to install the gatsy-source-buttercms package into your current gatsby project.\n\n## Configuration\n\nAdd to your `gatsby-config.js`.\n\n```JavaScript\nmodule.exports = {\n  plugins: [\n     {\n        resolve: `gatsby-source-buttercms`,\n        options: {\n              authToken: `\u003cAPI_TOKEN\u003e`,\n              // Optional array of Collection key \n              contentFields: {\n                keys: [`navigation_menu`],\n                // Optional. Set to 1 to enable test mode for viewing draft content.\n                test: 0,\n              },\n              // Optional array of page type keys\n              pageTypes: [`landing-page`],\n              // Optional array of locales (if configured in your account)\n              locales: [],\n              preview: 1, // Return draft content\n              levels: 2 // Optional. Defaults to 2. Defines the levels of relationships to serialize\n        },\n    }\n  ]\n}\n```\n\n## Usage\n\n### Query Blog Posts\n\nThe plugin maps all JSON fields documented in the [Butter CMS API Reference](https://buttercms.com/docs/api/#blog-engine) to GraphQL fields.\n\n```GraphQL\n{\n  allButterPost {\n    edges {\n      node {\n        id\n        date\n        url\n        created\n        published\n        author {\n          first_name\n          last_name\n          email\n          slug\n          bio\n          title\n          linkedin_url\n          facebook_url\n          instagram_url\n          pinterest_url\n          twitter_handle\n          profile_image\n        }\n        categories {\n          name\n          slug\n        }\n        tags {\n          name\n          slug\n        }\n        featured_image\n        slug\n        title\n        body\n        summary\n        seo_title\n        meta_description\n        status\n      }\n    }\n  }\n}\n```\n\n### Query Content Fields(Object)\n\n```GraphQL\n{\n  allButterContentField {\n    edges {\n      node {\n        key\n        value\n      }\n    }\n  }\n}\n```\n\n### Query Content Fields(Collection)\n\n```GraphQL\n{\n  allButterCollection {\n    edges {\n      node {\n        key\n        value{\n          #Your collection fields\n        }\n      }\n    }\n  }\n}\n```\n\n### Query Pages\n\nPage meta data is available in `meta` object. The `slug` and `page_title` fields are now deprecated and will be removed on 20/06/2021. Please, use `meta` field to get the `slug` and `page_type`.\n\n```GraphQL\n{\n  allButterPage {\n    edges {\n      node {\n        slug # is deprecated\n        page_type # is deprecated\n        meta {\n          published\n          updated\n          name\n          page_type\n          slug\n        }\n        # Your page’s fields …\n      }\n    }\n  }\n}\n```\n\n### Other\n\nView our [Gatsby Blog engine](https://buttercms.com/gatsbyjs-blog-engine/) and [Gatsby Full CMS](https://buttercms.com/gatsbyjs-cms/) for other examples of using ButterCMS with Gatsby.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttercms%2Fgatsby-source-buttercms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuttercms%2Fgatsby-source-buttercms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuttercms%2Fgatsby-source-buttercms/lists"}