Following are the avaiable pug plugins. To see how to include these plugins, see plugin configuration
@wethegit/sweet-potato-cooker/page-plugins
The image size plugin expects a path to an image on the files system and returns an object containing its width and height in pixels.
None.
Sweet potato config
const { imageSize } = require("@wethegit/sweet-potato-cooker/page-plugins");
module.exports = {
sitemap: true,
sourceDirectory: "src",
breakpoints,
pagePlugins: {
imageSize: imageSize(),
},
};
Usage
- const { width, height } = functions.imageSize('./src/public/assets/img/image.png')
img(src="/assets/img/image.png" width=width height=height)