{"_id":"@dream-bit-de/gatsby-plugin-better-page-tree","_rev":"3-2edf49e3b139f929ee7e950e3717521c","name":"@dream-bit-de/gatsby-plugin-better-page-tree","dist-tags":{"latest":"1.6.0"},"versions":{"1.4.1":{"name":"@dream-bit-de/gatsby-plugin-better-page-tree","version":"1.4.1","description":"This plugin will make the page tree provided by gatsby graphql more intuitive.","main":"index.js","scripts":{"test":"jest"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"repository":{"type":"git","url":"git+https://github.com/dream-bit-de/gatsby-plugin-better-page-tree.git"},"keywords":["gatsby","gatsby-plugin","gatsby-plugin-better-page-tree","sitepage","site","page","tree","better","child","parent","relation"],"author":{"name":"Güney Jung aka. Megajin"},"license":"MIT","dependencies":{"uuid":"^8.3.0"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^7.7.0","eslint-config-airbnb":"^18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.6","eslint-plugin-react-hooks":"^4.1.0","prettier":"2.1.0","jest":"^26.4.2"},"bugs":{"url":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/issues"},"homepage":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree#readme","gitHead":"3d1dfbc5fc97c1182c62336fb073752b53573eb1","_id":"@dream-bit-de/gatsby-plugin-better-page-tree@1.4.1","_nodeVersion":"12.3.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-mYgCEU/rnT6jQ74nBk5vjpHbPSfrFPSvBVMp8CMdDmk87vEmc8JbSYjFZwTsEwKIUXFC+1yW4KT/yiwBH7+pYA==","shasum":"ddea8921f1e84ac07c7d2922fa79e07a4090465a","tarball":"https://registry.npmjs.org/@dream-bit-de/gatsby-plugin-better-page-tree/-/gatsby-plugin-better-page-tree-1.4.1.tgz","fileCount":15,"unpackedSize":22917,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUkGvCRA9TVsSAnZWagAA920P/19a2n7W2+P96aquW58I\n1kiFtdbD/UgxgIMzqo3FKDZ7qx32ogQOXRmjkUBoIQG81JLe/g0CcmJIOOGB\nRQjP5Ln2pgMULqvApvBEA9Q/v5030bexmRdech3tcrgluAa1pvmPxsMvJXg6\nGzfBktZFp5T+yqC7PtiUf1p/Yf/nQEUFSWJfNeDARdt5qmOjoi6zzDfDeoz0\nXJmMKCfLmSmaWG9vMZP83XUoVoRmWJT460PNY4TsxtmFznmepV1giW0EqJQR\nnIs6TpGfVwL7KLZ8HF8Xbok1WqooZanTEoCHGoe46BldNMaJuI0WOfoIvlL9\nYAA9d2oDhi+7gvTETrOxn1ojtnpaN9zP1oDY7/rw+i47Zc0gGntkJa8SkaKM\n2k4LQUmBAb3BS8bf2tkj8A7nXNm7lQ1QZ+9xIRQPnc6pinp3r46WcIKKvWtg\nP5SED0AaH7jvfkjy0mN7ouEH0FXceOTzKhrP7NF4XWRVMg0fBPIyTQSGRMSV\n7rEEVU7P8f6oiEi3Vfr7yBsG55A2NEO6fD9nutLFogylFrldYDX8UbTgp4a6\neQTRRnWtr409HYEQPyCv0ju/6AdbliSAwH77Q00Kn5NLVkYo+WJ3G8E1RIX1\nX7Nhg/1wCFEitflkIz8PiwV/jJ7xL322zwaJEuVdGZYye5vk1RQbxktBIZuj\ng+rf\r\n=pAMO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDGyHAJd5nf0gOxSQaYC0S/UDcSK4KdkQVcsyoVgbwgSAiBwni4NkJDnq9Bl08CsCXf671YPUVayg7DUlmVdzdHgkw=="}]},"maintainers":[{"name":"megajin","email":"hello@dream-bit.de"}],"_npmUser":{"name":"megajin","email":"hello@dream-bit.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-better-page-tree_1.4.1_1599226286522_0.1677694587041516"},"_hasShrinkwrap":false},"1.5.0":{"name":"@dream-bit-de/gatsby-plugin-better-page-tree","version":"1.5.0","description":"This plugin will make the page tree provided by gatsby graphql more intuitive.","main":"index.js","scripts":{"test":"jest"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"repository":{"type":"git","url":"git+https://github.com/dream-bit-de/gatsby-plugin-better-page-tree.git"},"keywords":["gatsby","gatsby-plugin","gatsby-plugin-better-page-tree","sitepage","site","page","tree","better","child","parent","relation"],"author":{"name":"Güney Jung aka. Megajin"},"license":"MIT","dependencies":{"uuid":"^8.3.0"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^7.7.0","eslint-config-airbnb":"^18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.6","eslint-plugin-react-hooks":"^4.1.0","prettier":"2.1.0","jest":"^26.4.2"},"bugs":{"url":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/issues"},"homepage":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree#readme","gitHead":"728b1ad45fa50d0511b85211327ff1417f20d641","_id":"@dream-bit-de/gatsby-plugin-better-page-tree@1.5.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-BVpQPfDRmvKBobDOcc81kzB1BC/KrLKIhAIWQjwUrklByArUOEemUJc14X/N6Pjj86+n5WKWozL3KjsKuoUu5Q==","shasum":"9f368d822d35f0b39aa361fb6535486feb840a55","tarball":"https://registry.npmjs.org/@dream-bit-de/gatsby-plugin-better-page-tree/-/gatsby-plugin-better-page-tree-1.5.0.tgz","fileCount":13,"unpackedSize":22195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbJhMCRA9TVsSAnZWagAA58cQAIh+O6Xf11E8bxnEh1dW\n2GjClPeENXotToUFARKQF3JSyFl30n2cR5f+pmM+F1QyaKq/4jZcWhGHjA8y\n3pVUpovuND2DHNSkzEpxI+oYlsT4KOxu5Fh7c4UaCcgY6JdngMxF+4aikXGF\n+FgmFgjQ/JweUe56KLlM+xNkQq5j/n7CsfZSPYm6vLoGW0tGa8XqsioAcg0F\n2nNJaj2e9s2ZoGRCxHktArgbRnak69o7OswE6UARzN4dIO0/+922xJdTaXHj\nADnwYPCV/iqGzsPBSZDlg+7UhtRWNJCP504l1+ZjyBmqFY3k9xb8BdQddPWI\nOgvZXWVOsZPlyTVnf51kTI6aDrAq1AIaFYXuFlnf5rLcUC+6cx1v28bvI2m6\n5TF8eNltxFq1yCNnYKA9GlXbY+tq0AHWITRE5i0mBCeesmjtjgC4+whit7Y7\niwQcM2Akn6yhVoU8xl0uu1Ow1MdQSJfl4Tc/JQuoW9E8MrDRU3EH71uGqwOn\noZur0WShgjaR6ECUOm0PJ0ABp4VzVhrjB3U4jWIxmBN7d6vjRQ3xu1rIKC+B\nEGCNfZWOodqScwCFa/v9Zb5rqYsFY0/9PUEVjf51IM+OR3HdaFFrPl2x4fSw\ndzgs0oT+U0VK0YPmlyGpVmU3mEeC5Mr3HHzTPwWnLvOpvn1p7YzdbAp9r7CY\n2ERL\r\n=mCBB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfnTKmim30DAU5hkmyXFgEePNmSXs1mjxem9gSB88WHwIgfIEbIBfOGuNxGU4lqRW4M7g4plnQ5e6OK8Vxw1x8ZOg="}]},"maintainers":[{"name":"megajin","email":"hello@dream-bit.de"}],"_npmUser":{"name":"megajin","email":"hello@dream-bit.de"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-better-page-tree_1.5.0_1600952395907_0.8623874630746311"},"_hasShrinkwrap":false},"1.6.0":{"name":"@dream-bit-de/gatsby-plugin-better-page-tree","version":"1.6.0","description":"This plugin will make the page tree provided by gatsby graphql more intuitive.","main":"index.js","scripts":{"test":"npx jest"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"repository":{"type":"git","url":"git+https://github.com/dream-bit-de/gatsby-plugin-better-page-tree.git"},"keywords":["gatsby","gatsby-plugin","gatsby-plugin-better-page-tree","sitepage","site","page","tree","better","child","parent","relation"],"author":{"name":"Güney Jung aka. Megajin"},"license":"MIT","dependencies":{"uuid":"^8.3.0"},"devDependencies":{"babel-eslint":"^10.1.0","eslint":"^7.7.0","eslint-config-airbnb":"^18.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.6","eslint-plugin-react-hooks":"^4.1.0","prettier":"2.1.0","jest":"^26.4.2"},"bugs":{"url":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/issues"},"homepage":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree#readme","gitHead":"7c61774c78cdfbf3bd1fe6d80237c05e2011b442","_id":"@dream-bit-de/gatsby-plugin-better-page-tree@1.6.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-PblyY8ZhtKCr8hAdyy9UuK0Ve0+zC+2u5Z64oHtV/JPaM1wrHpzHm7qsIGKqkAeUjBG0B+dpPcBCkgjgdEsESQ==","shasum":"c1d6f31cdbab8cbb2c9a31549672e1b6eee7bd45","tarball":"https://registry.npmjs.org/@dream-bit-de/gatsby-plugin-better-page-tree/-/gatsby-plugin-better-page-tree-1.6.0.tgz","fileCount":13,"unpackedSize":23147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuTKbCRA9TVsSAnZWagAAkg8P/18WBhSmGLE+00gAtWVx\n58XaEo72KKtktVniEcolv8IRD+mZDPwKptIKhqw0Mju+kcPCC8KLXvwqnTt/\nMKlwsjrVe2dVvtQM9STfzw1RurOoOMXKdnqugoQk8nEWPDsZOpS+wqhCed+5\nOMXC+OjjoqC6FhqpGoe62iYxwun6ZIRlHm3ruvqiQyoevzph+pmhys4d+hNA\n1cAez7eHCaNmic2I8ZSrWrQMPYMr0udBKn3t2+1q4XV1KG8ThNYBKqwna52O\ncRBzDHKwR5lYEoN5L/4dsHbcnbVp3JlpwjkGJtpUjMI33XnYHo0q8D2Wf3mW\nwicA648ow9FvE8m91wRKojhT/naWTVoGtoFVAP+iOnGxMnLwW0Kclg+O7dQa\npGvgqYormYCKaw3j8XzkBv8rmQJOR8L7XDdJqiz+PzQ4tdL8sawQjlHfIh6G\nKzoJdNUNu72CiisHksaEt/EUH9d5cqmegocRCgGqjal6m1nRuslxUcDQHSTM\nFfS/kbTisxqMybddyO9ooYgBvUl52W3Dswyt1zONfNYxyiWbAbYXxvPrlL/9\nPwGxBWX4/3slfRFER82GQD9ik5hLxNcJa89I4NWpXmj1HUIYWJDPE1XTcwPA\ntJr9zGt5y5KSq9dtbNTnz7RaZACHtCGDChKP27TXrKJ9vGw63flAqYRY9V4Q\ng27a\r\n=houF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDg7nCIVNQTUgebkMdPb6n3hEf7HDI2TleunbUhkC0xKQIgYX+rhbKsv8hWlXZPBzeFO8JxSl6O2H5CR4SM0acFxJ8="}]},"_npmUser":{"name":"megajin","email":"hello@dream-bit.de"},"directories":{},"maintainers":[{"name":"megajin","email":"hello@dream-bit.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-better-page-tree_1.6.0_1605972634954_0.5114348615098545"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-04T13:31:26.274Z","1.4.1":"2020-09-04T13:31:26.688Z","modified":"2022-04-05T05:37:18.462Z","1.5.0":"2020-09-24T12:59:56.088Z","1.6.0":"2020-11-21T15:30:35.065Z"},"maintainers":[{"name":"megajin","email":"hello@dream-bit.de"}],"description":"This plugin will make the page tree provided by gatsby graphql more intuitive.","homepage":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree#readme","keywords":["gatsby","gatsby-plugin","gatsby-plugin-better-page-tree","sitepage","site","page","tree","better","child","parent","relation"],"repository":{"type":"git","url":"git+https://github.com/dream-bit-de/gatsby-plugin-better-page-tree.git"},"author":{"name":"Güney Jung aka. Megajin"},"bugs":{"url":"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/issues"},"license":"MIT","readme":"<p align=\"center\">\r\n<a href=\"https://www.gatsbyjs.com/\">\r\n  <img alt=\"Gatsby\" src=\"https://camo.githubusercontent.com/c82d5dbe0efc4f71771b4c656fd96b91d6103a8d/68747470733a2f2f7777772e6761747362796a732e636f6d2f4761747362792d4d6f6e6f6772616d2e737667\" width=\"35\" />\r\n</a>\r\n</p>\r\n<h1 align=\"center\">\r\n  gatsby-plugin-better-page-tree\r\n</h1>\r\n\r\n<p align=\"center\">\r\n  <a href=\"http://makeapullrequest.com\">  \r\n      <img alt=\"Gatsby\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen\" />\r\n  </a>\r\n  <a href=\"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/workflows/Node.js%20CI/badge.svg?branch=master\">\r\n    <img alt=\"CI Status\" src=\"https://github.com/dream-bit-de/gatsby-plugin-better-page-tree/workflows/Node.js%20CI/badge.svg?branch=master\" />\r\n  </a>\r\n</p>\r\n\r\n**This plugin will make the page tree provided by gatsby graphql more intuitive. It was created to overcome some issues with child and parent relations in gatsbyjs.**\r\n\r\nThe initial question on Stackoverflow was this one: [How do you figure out parent and child relations between pages in gatsbyjs?](https://stackoverflow.com/questions/63674700/how-do-you-figure-out-parent-and-child-relations-between-pages-in-gatsbyjs). After taking this directly to the [gatsby community](https://github.com/gatsbyjs/gatsby/issues/26752), the need for a plugin was clear.\r\n\r\n gatsby-plugin-better-page-tree will generate the relations like this: `/src/pages/subpages`,\r\n\r\n```\r\n/src/pages/parentpage/index.js\r\n/src/pages/parentpage/subpage/index.js\r\n```\r\n\r\nwill now give you:\r\n\r\n```JSON\r\n{\r\n  \"node\": {\r\n    \"id\": \"PageTree-parentpage-id-8496bef7-3809-4fac-8f97-ab2b98b7f54d\",\r\n    \"name\": \"Parentpage\",\r\n    \"pathRaw\": \"/parentpage/\",\r\n    \"pathNoTrail\": \"/parentpage\",\r\n    \"isparentpage\": true,\r\n    \"children\": [\r\n      {\r\n        \"id\": \"PageTree-parentpage/subpage-id-bc8cec01-3f85-47d2-aec9-2e3ddc76df32\",\r\n        \"name\": \"Subpage\",\r\n        \"pathRaw\": \"/parentpage/subpage/\",\r\n        \"pathNoTrail\": \"/parentpage/subpage\"\r\n      }\r\n    ]\r\n  },\r\n  \"node\": {\r\n    \"id\": \"PageTree-parentpage/subpage-id-bc8cec01-3f85-47d2-aec9-2e3ddc76df32\",\r\n    \"name\": \"Subpage\",\r\n    \"pathRaw\": \"/parentpage/subpage/\",\r\n    \"pathNoTrail\": \"/parentpage/subpage\",\r\n    \"isparentpage\": false,\r\n    \"children\": []\r\n  }\r\n}\r\n```\r\n\r\n## :mortar_board: Install\r\n\r\nJust use `npm install @dream-bit-de/gatsby-plugin-better-page-tree` or `yarn install @dream-bit-de/gatsby-plugin-better-page-tree`, it's your choice.\r\nAfter that you have to modify your `gatsby-config.js`:\r\n\r\n```javascript\r\nmodule.exports = {\r\n  siteMetadata: {\r\n    title: `Your Super Gatsby Site!`,\r\n    description: `I love Gatsby!`,\r\n    author: `Community,`,\r\n    siteUrl: `https://www.my-gatsby-site-yeeehaaaw.com/`\r\n  },\r\n  plugins: [\r\n    // ... other plugins\r\n    `@dream-bit-de/gatsby-plugin-better-page-tree`\r\n  ]\r\n};\r\n```\r\n\r\n## :tada: Usage\r\n\r\nTo use this for example in a sidebar you have to use it like this:\r\n\r\n`sidebar.js`:\r\n\r\n```JSX\r\nimport React from 'react';\r\nimport { Link, useStaticQuery, graphql } from 'gatsby';\r\n\r\nfunction Sidebar() {\r\n  const Pages = useStaticQuery(graphql`\r\n    query {\r\n      allPageTree {\r\n        edges {\r\n          node {\r\n            id\r\n            name\r\n            pathRaw\r\n            pathNoTrail\r\n            isRootPage\r\n            children {\r\n              id\r\n              ... on PageTree {\r\n                id\r\n                name\r\n                pathRaw\r\n                pathNoTrail\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  `);\r\n  const { nodes } = Pages.allSitePage;\r\n\r\nreturn (\r\n     {nodes.map((n) => (\r\n     <ul key={`sidebar-${n.id}`}>\r\n      <li>\r\n       <Link to={n.pathRaw}>\r\n        <span>{n.name}</span>\r\n        {\r\n         n.children && n.children.length > 0 ? (\r\n         {nodes.map((n) => (\r\n          <ul key={`sidebar-${n.id}`}>\r\n            <li>\r\n              <Link to={n.pathRaw}>\r\n                <span>{n.name}</span> \r\n              </Link>\r\n            </li>\r\n          </ul>\r\n         ) : null\r\n        }\r\n       </Link>\r\n      </li>\r\n     </ul>\r\n     ))}\r\n);\r\n\r\n```\r\n\r\nThat's it!\r\n\r\n**Be aware that the query will give you all pages in the first place! You have to make sure that no duplicates will show up in your sidebar, if that is what you need.**\r\n\r\n## :collision: Configuration\r\n\r\nTBD!\r\n\r\n## :star: contributing\r\n\r\nYou want to help us, and join the Dream-bit Community?\r\nGreat! Please make sure to check out and understand what is written in the following files:\r\n\r\n- CODE-OF-CONDUCT.md\r\n- CONTRIBUTING.md\r\n\r\nAs well as the gatsby-plugin docs:\r\n\r\n- [GatsbyJS Creating Plugins Docs](https://www.gatsbyjs.com/docs/creating-plugins/)\r\n\r\n## :blush: About Dream-bit\r\n\r\nAt dream-bit dreams become software!\r\nWe encourage people to do good things with software and bring humanity forward.\r\nYou can be a part of us by contributing or joining the community at https://dream-bit.de\r\n\r\nDevelop software with your :heart: as your :brain:.\r\n","readmeFilename":"README.md"}