{"id":15061733,"url":"https://github.com/moxystudio/gatsby-plugin-ipfs","last_synced_at":"2025-04-06T11:10:53.420Z","repository":{"id":57244671,"uuid":"142658876","full_name":"moxystudio/gatsby-plugin-ipfs","owner":"moxystudio","description":"Adds support for deploying Gatsby to IPFS by ensuring that assets are relative","archived":false,"fork":false,"pushed_at":"2023-01-24T21:17:26.000Z","size":643,"stargazers_count":115,"open_issues_count":7,"forks_count":37,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-30T10:08:02.753Z","etag":null,"topics":["build","gatsby","gatsby-plugin","ipfs","relative"],"latest_commit_sha":null,"homepage":null,"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/moxystudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-28T08:00:20.000Z","updated_at":"2024-12-30T14:37:37.000Z","dependencies_parsed_at":"2023-02-14T01:31:48.982Z","dependency_job_id":null,"html_url":"https://github.com/moxystudio/gatsby-plugin-ipfs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fgatsby-plugin-ipfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fgatsby-plugin-ipfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fgatsby-plugin-ipfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Fgatsby-plugin-ipfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moxystudio","download_url":"https://codeload.github.com/moxystudio/gatsby-plugin-ipfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471521,"owners_count":20944158,"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":["build","gatsby","gatsby-plugin","ipfs","relative"],"created_at":"2024-09-24T23:24:20.837Z","updated_at":"2025-04-06T11:10:53.372Z","avatar_url":"https://github.com/moxystudio.png","language":"JavaScript","funding_links":[],"categories":["工具","Tools"],"sub_categories":[],"readme":"# gatsby-plugin-ipfs\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/gatsby-plugin-ipfs\n[npm-image]:https://img.shields.io/npm/v/gatsby-plugin-ipfs.svg\n[downloads-image]:https://img.shields.io/npm/dm/gatsby-plugin-ipfs.svg\n[david-dm-url]:https://david-dm.org/moxystudio/gatsby-plugin-ipfs\n[david-dm-image]:https://img.shields.io/david/moxystudio/gatsby-plugin-ipfs.svg\n[david-dm-dev-url]:https://david-dm.org/moxystudio/gatsby-plugin-ipfs?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/gatsby-plugin-ipfs.svg\n\nAdds support for deploying [Gatsby](https://www.gatsbyjs.org/) websites to [IPFS](https://ipfs.io/) by ensuring that assets are relative.\n\n\n## Installation\n\n```sh\n$ npm install --save gatsby-plugin-ipfs\n```\n\n\n## Usage\n\nSet `prefixPath` to `__GATSBY_IPFS_PATH_PREFIX__` and include the plugin in your `gatsby-config.js` file:\n\n```js\nmodule.exports = {\n    pathPrefix: '__GATSBY_IPFS_PATH_PREFIX__',\n    plugins: [\n        'gatsby-plugin-ipfs',\n    ],\n};\n```\n\nAnd now, simply build the project with `npm run build -- --prefix-paths`. Better yet, set it by default in your `package.json`:\n\n```json\n\"scripts\": {\n  \"build\": \"gatsby build --prefix-paths\"\n},\n```\n\n\n## But how?\n\nIt turns out the Gatsby doesn't support relative paths. But I didn't gave up and came up with smart and ugly hacks to do so:\n\n- Adds a post-build step that iterates over files and transforms every `__GATSBY_IPFS_PATH_PREFIX__` occurrence\n- Adds a very small code snippet to every HTML page that defines the `__GATSBY_IPFS_PATH_PREFIX__` global based on the browser location\n\n\n## License\n\n[MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Fgatsby-plugin-ipfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoxystudio%2Fgatsby-plugin-ipfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Fgatsby-plugin-ipfs/lists"}