All Projects → moxystudio → Gatsby Plugin Ipfs

moxystudio / Gatsby Plugin Ipfs

Licence: mit
Adds support for deploying Gatsby to IPFS by ensuring that assets are relative

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gatsby Plugin Ipfs

Gatsby Remark Design System
🎨 Create your design system with Gatsby in Markdown
Stars: ✭ 90 (-8.16%)
Mutual labels:  gatsby
Space Sdk
The Space SDK is a JavaScript/Typescript library for building web and mobile applications leveraging Open Web and distributed protocols like IPFS, Textile, GunDB, and Ethereum.
Stars: ✭ 93 (-5.1%)
Mutual labels:  ipfs
Gatsby Shopify Theme
🛒 Simple theme to build a blazing simple and fast store with Gatsby and Shopify.
Stars: ✭ 95 (-3.06%)
Mutual labels:  gatsby
Skrub
A package to remove junk from Composer installations and trim build sizes.
Stars: ✭ 91 (-7.14%)
Mutual labels:  build
Gatsby Starter Stripe
🛒 A starter storefront & admin UI with Gatsby, Stripe, & Netlify Functions.
Stars: ✭ 92 (-6.12%)
Mutual labels:  gatsby
Gatsby Typescript
Alternative typescript support plugin for Gatsbyjs. Aims to make using typescript in Gatsby as painless as possible
Stars: ✭ 95 (-3.06%)
Mutual labels:  gatsby
Pybuilder
Software build automation tool for Python.
Stars: ✭ 1,290 (+1216.33%)
Mutual labels:  build
Ipfs Social Proof
IPFS Social Proof: A decentralized identity and social proof system
Stars: ✭ 96 (-2.04%)
Mutual labels:  ipfs
Package Managers
[ARCHIVED] 📦 IPFS Package Managers Task Force
Stars: ✭ 91 (-7.14%)
Mutual labels:  ipfs
Hmake
HyperMake - Makes Builds Green without Worrying about Pre-requisites
Stars: ✭ 95 (-3.06%)
Mutual labels:  build
Tutorial Ubuntu 18.04 Install Nvidia Driver And Cuda And Cudnn And Build Tensorflow For Gpu
Ubuntu 18.04 How to install Nvidia driver + CUDA + CUDNN + build tensorflow for gpu step by step command line
Stars: ✭ 91 (-7.14%)
Mutual labels:  build
Vue Ethereum Ipfs
Distributed Application Starter: Vue front-end, Ethereum / IPFS Backend
Stars: ✭ 1,312 (+1238.78%)
Mutual labels:  ipfs
Gatsby Remark Social Cards
Gatsby remark plugin for generating social card graphics
Stars: ✭ 95 (-3.06%)
Mutual labels:  gatsby
Rebar3
Erlang build tool that makes it easy to compile and test Erlang applications and releases.
Stars: ✭ 1,295 (+1221.43%)
Mutual labels:  build
Gatsby Theme Firebase
🔥 A Gatsby Theme for adding Firebase to your application.
Stars: ✭ 96 (-2.04%)
Mutual labels:  gatsby
Builder
Drag and drop page building using your code components
Stars: ✭ 1,281 (+1207.14%)
Mutual labels:  gatsby
Gatsby Plugin Advanced Sitemap
Advanced XML Sitemaps for Gatsby.js
Stars: ✭ 94 (-4.08%)
Mutual labels:  gatsby
Aaronvandenberg.nl
⚛️ Web Developers portfolio build with Gatsby.js & React.js
Stars: ✭ 98 (+0%)
Mutual labels:  gatsby
Node Typescript Mongodb
node js typescript mongodb express generator yo
Stars: ✭ 96 (-2.04%)
Mutual labels:  build
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+1259.18%)
Mutual labels:  build

gatsby-plugin-ipfs

NPM version Downloads Dependency status Dev Dependency status

Adds support for deploying Gatsby websites to IPFS by ensuring that assets are relative.

Installation

$ npm install --save gatsby-plugin-ipfs

Usage

Set prefixPath to __GATSBY_IPFS_PATH_PREFIX__ and include the plugin in your gatsby-config.js file:

module.exports = {
    pathPrefix: '__GATSBY_IPFS_PATH_PREFIX__',
    plugins: [
        'gatsby-plugin-ipfs',
    ],
};

And now, simply build the project with npm run build -- --prefix-paths. Better yet, set it by default in your package.json:

"scripts": {
  "build": "gatsby build --prefix-paths"
},

But how?

It 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:

  • Adds a post-build step that iterates over files and transforms every __GATSBY_IPFS_PATH_PREFIX__ occurrence
  • Adds a very small code snippet to every HTML page that defines the __GATSBY_IPFS_PATH_PREFIX__ global based on the browser location

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].