lzane/hexo-light-gallery

Improved documentation please

Opened this issue · 7 comments

This plugin looks promising but I have no idea how to use it. More documentation and an example would be nice.

lzane commented

The README only mentions how to install it, not actually use it. I'm sure you know how to use, you wrote it. A usage example would go a long way.

lzane commented

Hi @steveww ,
The plugin takes effect automatically once you config it properly. You just need to open an article page with some images and you can see the effect.

@lzane
emmm, thanks for your effor first, it can run well without plugins.
however, the doc and comment with plugins are not clear enough, I try a string of ways to enable plugins, but failed.

Here is the config:

lightgallery:
  plugins:
    lg-pager: /js/lg-pager.min.js
    lg-thumbnail: /js/lg-thumbnail.js

And I download the js files below from here, then mkdir on local path hexo/source/js and put js files into it.

But when I click the image, the plugin doesn't work, after I check the console(F12), I found some error:
Uncaught SyntaxError: Unexpected token '=' lg-thumbnail.js:6
and
Uncaught SyntaxError: Invalid left-hand side in assignment lg-pager.min.js:7

This makes me confused, maybe the error is caused by the lg*.js but I cannot ensure it, so I wonder is it the right way to enable plugins? If not, please tell me the right way, thanks.

PS: The JS is loaded like http://localhost:4000/js/lg-pager.min.js,

@lzane No effect can be seen, and I also want to know how to set the plugin, such as where should the lg-* scripts be put, and which _config.yml (of the site root or the theme) should be set? Can you give an example? Thanks!

I am also looking to turn on thumbnail mode. From looking at the source it appears it may be locked such that using any of the options from the plugins is impossible.

What wasn't clear for me was I needed to use an img tag. I was using Markdown syntax and nothing was changed, no js loaded, etc. When I changed a post to use an img tag instead of ![]() the js showed up and everything worked as expected.