valaxy-addon-lightgallery

NPM version

valaxy-addon-lightgallery provides a gallery preview effect based on lightgallery.

How to use

Install dependencies

bash
npm i valaxy-addon-lightgallery

Load the plugin

valaxy.config.ts
ts
import { defineValaxyConfig } from 'valaxy'
import { addonLightGallery } from 'valaxy-addon-lightgallery'

export default defineValaxyConfig({
  addons: [
    addonLightGallery(),
  ],
})

Use directly in the article

Insert the component directly in Markdown.

md
---
photos:
  - caption: Me
    src: https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-alpha-compressed.png
    desc: 'I remember the run under the sunset that day.'
---
<!-- The style of gallery -->
<VAGallery :photos="frontmatter.photos" />

<!-- You can also use the style of the photo separately -->
<VAPhoto :photo="frontmatter.photos[0]" />

FAQ

Rollup failed to resolve import "lightgallery/vue/LightGalleryVue.umd.min.js"

Lock packages.json dependencies version to "lightgallery": "2.7.2".

Contributors