Giter Site home page Giter Site logo

grav-plugin-photoswipe's Introduction

Grav PhotoSwipe Plugin

This is a quick and dirty implementation of Dmitry Semenov's PhotoSwipe gallery for the Grav CMS. Documentation is at a basic level, see source code for all details.

Install

  1. Clone the repository to your plugins folder
cd /var/www/grav/user/plugins
git clone https://github.com/dersimn/grav-plugin-photoswipe photoswipe
  1. Go inside the folder that you cloned and install dependencies
cd photoswipe
git submodule init
git submodule update
  1. Activate the plugin by copying photoswipe.yaml containing the default settings to your config folder
cp photoswipe.yaml ../../config/plugins

If you're using the Grav Admin plugin, you can

Usage

Add lightbox http parameter to every image that you want to include in the lightbox gallery. Simply:

![Caption text](some_picture.png?lightbox)

Maybe you want to resize the image to get a thumbnail-ish experience:

![Caption text](some_picture.png?lightbox&resize=200,200)

The complete magic of this plugin happens in this file, see source code for further information.

Global settings

Enable/disable for all pages by editing /var/www/grav/user/config/plugins/photoswipe.yaml. Alternatively use the Grav Admin plugin.

enabled: true
active: true
  • enabled: Globally enable/disable the plugin. This setting can NOT be overridden by the page header.
  • active: Default setting for all pages. This can be overridden by the page header.

Override settings for each page

In the header of a page add

photoswipe:
    active: false

to enable/disable the plugin for a certain page.

License

PhotoSwipe itself was licensed by Dmitry Semenov under MIT license with the exception that you should not create a public WordPress plugin based on it. I'm therefore releasing my plugin under MIT license as well.

Attribution is not required, but much appreciated.

grav-plugin-photoswipe's People

Contributors

dersimn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grav-plugin-photoswipe's Issues

Use for gallery / grid

Thanks for your plugin,
I saw http://www.timovolz.de/projekte which uses photoswipe, maybe this plugin even, in grav. I wondered how they are using photoswipe to greate a grid of thumbnails. They combine it with lazyloaded for a good effect.
Would anyone know how to use photoswipe for building such a grid?
Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.