Gridsome

Installation

You can install Cortado.js via npm:


npm install cortado-js

Usage

In Gridsome projects, Cortado.js optimizes images for improved performance and provides resizing capabilities. By using the optimizeImage and resizeImage functions, you can efficiently manage images and resize them according to your requirements. Here's how to incorporate both methods into your Gridsome project:


// Import optimizeImage and resizeImage functions from Cortado.js
import { optimizeImage, resizeImage } from 'cortado-js';

export default {
  async mounted() {
    // Call optimizeImage with the path to your image
    const optimizedImage = await optimizeImage('image.jpg');
    // Use the optimized image source in your component
    this.optimizedImageSrc = optimizedImage;
    
    // Call resizeImage to resize the image to a specific width and height
    const resizedImage = await resizeImage('image.jpg', { width: 300, height: 200 });
    // Use the resized image source in your component
    this.resizedImageSrc = resizedImage;
  },
};

Cortado.js seamlessly integrates into your Gridsome workflow, providing both image optimization and resizing capabilities to enhance your site's performance.

© 2024 Cortado. All rights reserved.

Designed by Ditych. Powered by Framer.

© 2024 Cortado. All rights reserved.

Designed by Ditych. Powered by Framer.