eleventy-plugin-local-images icon indicating copy to clipboard operation
eleventy-plugin-local-images copied to clipboard

Sample code

Open earlyriser opened this issue 4 years ago • 1 comments

Thanks for creating this.

Do you have a sample of this plugin installed?

I have followed the instructions but I don't get it to work.

` const axios = require('axios') const localImages = require('eleventy-plugin-local-images');

module.exports = function (eleventyConfig) {

eleventyConfig.addCollection('pages', async collection => { const response = await axios({ method: 'get', url: 'http://localhost:1337/pages' }) .then(response => { return response.data }) .catch(error => { // Handle error }) console.log(response);

return response ? response : []

})

eleventyConfig.addPlugin(localImages, {
  distPath: '_site',
  assetPath: '/assets',
  selector: 'img',
  verbose: true
});

} `

_site folder has this structure: -assets -en --page1 --page2 -fr --page1 --page2

Thanks!

earlyriser avatar May 18 '20 12:05 earlyriser

I solved this issue applying the change on the PR: https://github.com/robb0wen/eleventy-plugin-local-images/pull/5/files

earlyriser avatar May 18 '20 12:05 earlyriser