eleventy-plugin-local-images
eleventy-plugin-local-images copied to clipboard
Sample code
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!
I solved this issue applying the change on the PR: https://github.com/robb0wen/eleventy-plugin-local-images/pull/5/files