cofob / postcss-ipfs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PostCSS IPFS PostCSS

PostCSS plugin for replacing IPFS strings.

Write this:

.foo {
  background-image: url(ipfs://Qmhash/path/to/file.png);
}

.bar {
  background-image: url(ipns://some.ipns.link/path/to/file.png);
}

And get this:

.foo {
  background-image: url(https://ipfs.io/ipfs/Qmhash/path/to/file.png);
}

.bar {
  background-image: url(https://ipfs.io/ipns/some.ipns.link/path/to/file.png);
}

Installation

$ npm install postcss-ipfs

Usage

postcss([ require('postcss-ipfs') ])

See PostCSS docs for examples regarding usage.

Options

gateway

  • Type: string
  • Default: https://ipfs.io/

Gateway that will replace ipfs:// links.

About

License:MIT License


Languages

Language:JavaScript 100.0%