{"id":29630847,"url":"https://github.com/mirabilio/gatsby-plugin-json-remark","last_synced_at":"2025-07-21T11:06:40.404Z","repository":{"id":38174951,"uuid":"253030116","full_name":"mirabilio/gatsby-plugin-json-remark","owner":"mirabilio","description":"gatsby-plugin-json-remark is a GatsbyJs plugin that transforms markdown content from JSON files. The new MarkdownRemark nodes are placed inside the original gatsby-transformer-json node tree. Transformed HTML is also populated in new node properties as the original JSON key names appended with \"Html\".","archived":false,"fork":false,"pushed_at":"2023-01-05T18:49:48.000Z","size":3811,"stargazers_count":4,"open_issues_count":21,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T17:56:19.306Z","etag":null,"topics":["ecmascript2018","gatsby","gatsby-json","gatsby-plugin","gatsby-remark","gatsbyjs"],"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/mirabilio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-04T15:19:55.000Z","updated_at":"2024-06-15T03:50:10.000Z","dependencies_parsed_at":"2023-02-04T11:01:52.888Z","dependency_job_id":null,"html_url":"https://github.com/mirabilio/gatsby-plugin-json-remark","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/mirabilio/gatsby-plugin-json-remark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirabilio%2Fgatsby-plugin-json-remark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirabilio%2Fgatsby-plugin-json-remark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirabilio%2Fgatsby-plugin-json-remark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirabilio%2Fgatsby-plugin-json-remark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirabilio","download_url":"https://codeload.github.com/mirabilio/gatsby-plugin-json-remark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirabilio%2Fgatsby-plugin-json-remark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266270381,"owners_count":23902731,"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":["ecmascript2018","gatsby","gatsby-json","gatsby-plugin","gatsby-remark","gatsbyjs"],"created_at":"2025-07-21T11:06:39.485Z","updated_at":"2025-07-21T11:06:40.388Z","avatar_url":"https://github.com/mirabilio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.gatsbyjs.org\"\u003e\n    \u003cimg alt=\"Gatsby\" src=\"https://www.gatsbyjs.org/monogram.svg\" width=\"60\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003e\n  gatsby-plugin-json-remark\n\u003c/h1\u003e\n\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![codecov](https://codecov.io/gh/mirabilio/gatsby-plugin-json-remark/branch/master/graph/badge.svg)](https://codecov.io/gh/mirabilio/gatsby-plugin-json-remark)\n\n`gatsby-plugin-json-remark` is a [GatsbyJs](https://www.gatsbyjs.org) plugin that transforms markdown content from JSON files. The new MarkdownRemark nodes are placed inside the original `gatsby-transformer-json` node tree. Transformed HTML is also populated in new node properties as the original JSON key names appended with \"Html\".\n\nThis plugin piggybacks off of the existing `gatsby-transformer-remark` plugin configuration in `gatsby-config.json` and honors all additional parsing provided by its sub-plugins (e.g. `gatsby-remark-prismjs`). This is accomplished on the \\*Html fields by retrieving the HTML from the MarkdownRemark nodes' own `html` resolvers.\n\nThe ability to place markdown in structured JSON files comes in handy for CMS software that stores its content inside JSON files. In [TinaCMS](https://tinacms.org/) for example, `gatsby-plugin-json-remark` can be used to embed markdown in the structured page content using [TinaCMS' markdown blocks feature](https://tinacms.org/docs/fields/blocks).\n\n\u003e Please create an issue for question, bug, idea, etc. If this plugin doesn't fit your particular use case but you feel that it should, please open an issue to request the new feature. PRs welcome 👍.\n\n**Note**: It is recommended to use `gatsby-remark-remove-root-p-tag` in tandem with this plugin. `gatsby-transformer-remark` will often automatically wrap a paragraph node around markdown snippets, resulting in an unintended `\u003cp\u003e` tag wrapping the transformed HTML. `gatsby-remark-remove-root-p-tag` will remove the paragraph parent from the markdown AST.\n\n## Install\n\nAdd `gatsby-plugin-json-remark` package to your gatsby project:\n\nnpm\n\n```shell\nnpm i gatsby-plugin-json-remark\n```\n\nyarn\n\n```shell\nyarn add gatsby-plugin-json-remark\n```\n\n## Configure\n\nAdd plugin to the `gatsby-plugin-json-remark` plugins array in your `gatsby-config.js`:\n\n```javascript\nmodule.exports = {\n  plugins: [\n    // ...\n    {\n      resolve: `gatsby-plugin-json-remark`,\n      options: {\n        paths: [\n          `${__dirname}/content/pages`,\n          `${__dirname}/content/json-markdown`,\n        ], // Process all JSON files in these directories.\n        pathsExclude: [`${__dirname}/content/pages/contact.json`], // Process all files in the directories above, except `pages/contact.json`.\n        fieldNameBlacklist: [\n          \"id\",\n          \"children\",\n          \"parent\",\n          \"fields\",\n          \"internal\",\n          \"path\",\n          \"template\",\n        ],\n      },\n    },\n    // ...\n  ],\n};\n```\n\nOptional: add `gatsby-remark-remove-root-p-tag` as a sub-plugin to `gatsby-transformer-remark' to remove unwanted HTML paragraph tags from the generaged HTML.\n\n```javascript\nmodule.exports = {\n  plugins: [\n    // ...\n    {\n      resolve: `gatsby-transformer-remark`,\n      options: {\n        plugins: [\n          {\n            resolve: `gatsby-remark-remove-root-p-tag`,\n            options: {\n              parents: [\"gatsby-plugin-json-remark\", \"default-site-plugin\"], // Required: will process only the MarkdownRemark nodes created by these plugins\n            },\n          },\n        ],\n      },\n    },\n    // ...\n  ],\n};\n```\n\n## Options\n\n### `paths` (required)\n\nValues can be JSON file paths or directory paths. The plugin will only process these files and directories. **Note:** see requirements below.\n\n### `pathsExclude` (optional)\n\nValues can be JSON file paths or directory paths which serve as exceptions to the `paths` option. The plugin will ignore the files and directories provided here, even if they are configured with the `paths` option. This option is handy when a directory is configured with the `paths` option but certain files in that directory should be ignored.\n\n### `fieldNameBlacklist` (optional / recommended)\n\nA list of JSON keys that will be ignored in the source JSON files. This is useful for preventing conflicts with the reserved property names of the [Gatsby node data structure](https://www.gatsbyjs.org/docs/node-interface/).\n\n## Requirements\n\n### `gatsby-config.js` Dependencies\n\n- `gatsby-transformer-remark`\n- `gatsby-source-filesystem` _Configured with at least one directory containing JSON files. The `paths` option of `gatsby-plugin-json-remark` must contain at least a directory or a file that is also configured with `gatsby-source-filesystem`. Otherwise, there will be no JSON nodes to process._\n\n### Environment\n\n- Node \u003e=12.16.1\n- Gatsby v2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirabilio%2Fgatsby-plugin-json-remark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirabilio%2Fgatsby-plugin-json-remark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirabilio%2Fgatsby-plugin-json-remark/lists"}