This is for the front page.
I've made an image collection in gridsome.server.js by scanning a folder full of images and creating nodes, each containing the name and the path of the image:
let dir = fs.opendirSync(process.cwd() + '/static/images')
let fd, fn, nameParts
const imagesColl = actions.addCollection('images')
while (!!(fd = dir.readSync())) {
fn = fd.name
nameParts = fn.split('.')
imagesColl.addNode({
name: nameParts[0],
path: '/images/' + fn
})
}
dir.close()
In the title page, I'm creating a 4x2 grid of these images.
The graphql query looks like this:
images:allImages {
edges {
node {
name
path
}
}
}
and then in my vue page component, I'm using the images like this
...
<div>
<div class="grid grid-cols-4 shadow-xl">
<g-image width="100" v-for="(edge, ix) of $page.images.edges" :key="ix"
:src="edge.node.path" />
</div>
</div>
So, the collection is being created just fine, I'm able to query them in the page, but It doesn't seem like the g-image processor is getting invoked at all.
I'm specifying a width of "100", which I expect to see a grid of smallish images - but it's not happening. Basically the resulting output is just the browser sizing them down to "dumbnails" about 300px across (for this page size.)
Any thoughts appreciated.