Skip to content

unlocomqx/vitepress-plugin-image-optimize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vitepress-plugin-image-optimize

A plugin to convert and resize images in VitePress.

Installation

pnpm add -D vitepress-plugin-image-optimize

Usage

// .vitepress/config.ts import {optimizeImages} from "vitepress-plugin-image-optimize"; // https://vitepress.dev/reference/site-config export default defineConfig({ // ..... your existing VitePress config markdown: { config: (md) => { md.use(optimizeImages({ srcDir: "docs", // Default: "docs" quality: 90, // Default: 90 lazyLoading: true, // Default: false })) } } })

To mark an image as 2x, add @2x to its name. For example, my-image@2x.png.

The plugin will make a smaller version of the image and show it on devices with a smaller screen resolution.

Contributing

It's most welcome. Please open an issue or a pull request.

About

A plugin to optimize images on a VitePress site

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •