Skip to content

capsia37/gridsome-plugin-remote-image

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gridsome Local Image Downloader

This is a Gridsome plugin to download remote images based on @noxify/gridsome-plugin-remote-image

The aim of this plugin is to solve two limitations from the original one.

In this plugin you won't need a target field parameter, because it overwrites the source field. If you need to keep the remote path use the original plugin.

There are also a few more changes:

This plugin uses the String type instead of the Image type. To use it you should set the src attribute of your g-image as follows:

:src="require(`!!assets-loader!@/${object.img}`)"

Install

npm i @capsia/gridsome-plugin-local-image

Setup

//gridsome.config.js

module.exports = {
  siteName: 'Gridsome',
  plugins: [
    //...
    {
      use: '@capsia/gridsome-plugin-local-image',
      options: {
        'typeName' : 'Entry',
        'sourceField': 'object.img',
        'targetPath': './src/assets/remoteImages'
      }
    },
    {
      use: '@capsia/gridsome-plugin-local-image',
      options: {
        'typeName' : 'Entry',
        'sourceField': 'remoteImages',
        'targetPath': './src/assets/remoteImages'
      }
    }
  ]
  //...
}

Documentation

You can find more info at the original documentation:

https://webstone.info/documentation/gridsome-plugin-remote-image

About

simple plugin to download remote images in gridsome

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%