al_img_tools 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE +20 -0
- data/README.md +75 -0
- data/lib/al_img_tools.rb +370 -0
- data/lib/assets/al_img_tools/js/venobox-setup.js +5 -0
- data/lib/assets/al_img_tools/js/zoom.js +6 -0
- metadata +121 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: d8b4ced26c99121267f851f98b6d39b0ea5d0ccfca31a3b91d9430c56b0c0fda
|
|
4
|
+
data.tar.gz: caea3676f25c3d0da852926405aab3d9a9969a0d9b036d1313ebc220e760ecd6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 0c8738d7198c4c9f850c031f983801c4e48ec9bb6a02a58373401c8a216bbe498fe93804f2a5f0255887e397e54a3efe1a8f794f9a91aaa98e144068902fed9c
|
|
7
|
+
data.tar.gz: c46480a6191393cc13d69de9ee494e39ef8f2c1146cd6bdad068eec319790ca6f4ad1ca3835b98e69aa2a237d2bde7ea69a3aa5b2bbdbb6be20bb34cfe6df2df
|
data/CHANGELOG.md
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Maruan Al-Shedivat.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Al-Img-Tools
|
|
2
|
+
|
|
3
|
+
A Jekyll plugin that provides various image manipulation features for al-folio sites.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Image comparison sliders
|
|
8
|
+
- Lightbox galleries
|
|
9
|
+
- Medium zoom
|
|
10
|
+
- Image sliders
|
|
11
|
+
- PhotoSwipe galleries
|
|
12
|
+
- Spotlight galleries
|
|
13
|
+
- VenoBox galleries
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
Add this line to your Jekyll site's Gemfile:
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
gem 'al_img_tools'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
And then execute:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
$ bundle install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
1. Add the plugin to your site's `_config.yml`:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
plugins:
|
|
35
|
+
- al_img_tools
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Use image features in your pages:
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
---
|
|
42
|
+
layout: page
|
|
43
|
+
title: Gallery
|
|
44
|
+
images:
|
|
45
|
+
lightbox2: true # Enable Lightbox2 gallery (or use `gallery: true`)
|
|
46
|
+
compare: true # Enable image comparison slider
|
|
47
|
+
slider: true # Enable image slider
|
|
48
|
+
photoswipe: true # Enable PhotoSwipe gallery
|
|
49
|
+
spotlight: true # Enable Spotlight gallery
|
|
50
|
+
venobox: true # Enable VenoBox gallery
|
|
51
|
+
medium_zoom: true # Optional per-page medium zoom override
|
|
52
|
+
---
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
3. Add the image tags to your layout:
|
|
56
|
+
|
|
57
|
+
- In the `<head>` (for CSS):
|
|
58
|
+
|
|
59
|
+
```liquid
|
|
60
|
+
{% al_img_tools_styles %}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- Before `</body>` (for JavaScript):
|
|
64
|
+
|
|
65
|
+
```liquid
|
|
66
|
+
{% al_img_tools_scripts %}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
After checking out the repo, run `bundle install` to install dependencies.
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
Bug reports and pull requests are welcome on GitHub.
|
data/lib/al_img_tools.rb
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
require 'jekyll'
|
|
2
|
+
|
|
3
|
+
module AlImgTools
|
|
4
|
+
# Directory structure constants
|
|
5
|
+
PLUGIN_NAME = 'al_img_tools'
|
|
6
|
+
ASSETS_DIR = 'assets'
|
|
7
|
+
JS_DIR = 'js'
|
|
8
|
+
JS_FILES = ['zoom.js', 'venobox-setup.js'].freeze
|
|
9
|
+
|
|
10
|
+
# Custom StaticFile class to track when files are written
|
|
11
|
+
class PluginStaticFile < Jekyll::StaticFile
|
|
12
|
+
def write(dest)
|
|
13
|
+
Jekyll.logger.debug("AlImgTools:", "Attempting to copy from #{path} to #{destination(dest)}")
|
|
14
|
+
super(dest).tap do |result|
|
|
15
|
+
if result
|
|
16
|
+
Jekyll.logger.info("AlImgTools:", "Successfully copied #{name} from #{path} to #{destination(dest)}")
|
|
17
|
+
else
|
|
18
|
+
Jekyll.logger.error("AlImgTools:", "Failed to copy #{name} from #{path}")
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class AssetsGenerator < Jekyll::Generator
|
|
25
|
+
safe true
|
|
26
|
+
priority :low
|
|
27
|
+
|
|
28
|
+
def generate(site)
|
|
29
|
+
# Get the plugin's assets directory path - now includes the full desired structure
|
|
30
|
+
plugin_lib_path = File.expand_path('.', __dir__)
|
|
31
|
+
Jekyll.logger.info("AlImgTools:", "Plugin lib directory: #{plugin_lib_path}")
|
|
32
|
+
|
|
33
|
+
# Register each JS file
|
|
34
|
+
JS_FILES.each do |js_file|
|
|
35
|
+
# Construct source path - now includes the full path structure we want in the output
|
|
36
|
+
source_path = File.join(plugin_lib_path, ASSETS_DIR, PLUGIN_NAME, JS_DIR, js_file)
|
|
37
|
+
Jekyll.logger.info("AlImgTools:", "Looking for source file: #{source_path}")
|
|
38
|
+
|
|
39
|
+
# Only add the file if it exists
|
|
40
|
+
if File.exist?(source_path)
|
|
41
|
+
# Create a static file with:
|
|
42
|
+
# - site: the Jekyll site instance
|
|
43
|
+
# - base: the base directory containing the file
|
|
44
|
+
# - dir: the directory relative to base (used to construct the destination path)
|
|
45
|
+
# - name: the file name
|
|
46
|
+
static_file = PluginStaticFile.new(
|
|
47
|
+
site,
|
|
48
|
+
plugin_lib_path, # base directory
|
|
49
|
+
File.join(ASSETS_DIR, PLUGIN_NAME, JS_DIR), # source dir relative to base
|
|
50
|
+
js_file # filename
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
# The file will be copied to: _site/assets/al_img_tools/js/[filename]
|
|
54
|
+
site.static_files << static_file
|
|
55
|
+
Jekyll.logger.info("AlImgTools:", "Registered #{js_file} for copying to #{ASSETS_DIR}/#{PLUGIN_NAME}/#{JS_DIR}/")
|
|
56
|
+
else
|
|
57
|
+
Jekyll.logger.warn("AlImgTools:", "JavaScript file not found: #{source_path}")
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Library configurations
|
|
64
|
+
LIBRARIES = {
|
|
65
|
+
'img-comparison-slider' => {
|
|
66
|
+
'integrity' => {
|
|
67
|
+
'css' => 'sha256-3qTIuuUWIFnnU3LpQMjqiXc0p09rvd0dmj+WkpQXSR8=',
|
|
68
|
+
'js' => 'sha256-EXHg3x1K4oIWdyohPeKX2ZS++Wxt/FRPH7Nl01nat1o=',
|
|
69
|
+
'map' => 'sha256-3wfqS2WU5kGA/ePcgFzJXl5oSN1QsgZI4/edprTgX8w='
|
|
70
|
+
},
|
|
71
|
+
'url' => {
|
|
72
|
+
'css' => 'https://cdn.jsdelivr.net/npm/img-comparison-slider@{{version}}/dist/styles.min.css',
|
|
73
|
+
'js' => 'https://cdn.jsdelivr.net/npm/img-comparison-slider@{{version}}/dist/index.min.js',
|
|
74
|
+
'map' => 'https://cdn.jsdelivr.net/npm/img-comparison-slider@{{version}}/dist/index.js.map'
|
|
75
|
+
},
|
|
76
|
+
'version' => '8.0.6'
|
|
77
|
+
},
|
|
78
|
+
'lightbox2' => {
|
|
79
|
+
'integrity' => {
|
|
80
|
+
'css' => 'sha256-uypRbsAiJcFInM/ndyI/JHpzNe6DtUNXaWEUWEPfMGo=',
|
|
81
|
+
'js' => 'sha256-A6jI5V9s1JznkWwsBaRK8kSeXLgIqQfxfnvdDOZEURY='
|
|
82
|
+
},
|
|
83
|
+
'url' => {
|
|
84
|
+
'css' => 'https://cdn.jsdelivr.net/npm/lightbox2@{{version}}/dist/css/lightbox.min.css',
|
|
85
|
+
'js' => 'https://cdn.jsdelivr.net/npm/lightbox2@{{version}}/dist/js/lightbox.min.js'
|
|
86
|
+
},
|
|
87
|
+
'version' => '2.11.5'
|
|
88
|
+
},
|
|
89
|
+
'medium_zoom' => {
|
|
90
|
+
'integrity' => {
|
|
91
|
+
'js' => 'sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc='
|
|
92
|
+
},
|
|
93
|
+
'url' => {
|
|
94
|
+
'js' => 'https://cdn.jsdelivr.net/npm/medium-zoom@{{version}}/dist/medium-zoom.min.js'
|
|
95
|
+
},
|
|
96
|
+
'version' => '1.1.0'
|
|
97
|
+
},
|
|
98
|
+
'photoswipe' => {
|
|
99
|
+
'integrity' => {
|
|
100
|
+
'js' => 'sha256-VCBpdxvrNNxGHNuTdNqK9kPFkev2XY7DYzHdmgaB69Q='
|
|
101
|
+
},
|
|
102
|
+
'url' => {
|
|
103
|
+
'css' => 'https://cdn.jsdelivr.net/npm/photoswipe@{{version}}/dist/photoswipe.min.css',
|
|
104
|
+
'js' => 'https://cdn.jsdelivr.net/npm/photoswipe@{{version}}/dist/photoswipe.esm.min.js'
|
|
105
|
+
},
|
|
106
|
+
'version' => '5.4.4'
|
|
107
|
+
},
|
|
108
|
+
'photoswipe-lightbox' => {
|
|
109
|
+
'integrity' => {
|
|
110
|
+
'js' => 'sha256-uCw4VgT5DMdwgtjhvU9e98nT2mLZXcw/8WkaTrDd3RI='
|
|
111
|
+
},
|
|
112
|
+
'url' => {
|
|
113
|
+
'js' => 'https://cdn.jsdelivr.net/npm/photoswipe@{{version}}/dist/photoswipe-lightbox.esm.min.js'
|
|
114
|
+
},
|
|
115
|
+
'version' => '5.4.4'
|
|
116
|
+
},
|
|
117
|
+
'swiper' => {
|
|
118
|
+
'integrity' => {
|
|
119
|
+
'css' => 'sha256-yUoNxsvX+Vo8Trj3lZ/Y5ZBf8HlBFsB6Xwm7rH75/9E=',
|
|
120
|
+
'js' => 'sha256-BPrwikijIybg9OQC5SYFFqhBjERYOn97tCureFgYH1E=',
|
|
121
|
+
'map' => 'sha256-lbF5CsospW93otqvWOIbbhj80CjazrZXvamD7nC7TBI='
|
|
122
|
+
},
|
|
123
|
+
'url' => {
|
|
124
|
+
'css' => 'https://cdn.jsdelivr.net/npm/swiper@{{version}}/swiper-bundle.min.css',
|
|
125
|
+
'js' => 'https://cdn.jsdelivr.net/npm/swiper@{{version}}/swiper-element-bundle.min.js',
|
|
126
|
+
'map' => 'https://cdn.jsdelivr.net/npm/swiper@{{version}}/swiper-element-bundle.min.js.map'
|
|
127
|
+
},
|
|
128
|
+
'version' => '11.0.5'
|
|
129
|
+
},
|
|
130
|
+
'spotlight' => {
|
|
131
|
+
'integrity' => {
|
|
132
|
+
'css' => 'sha256-Dsvkx8BU8ntk9Iv+4sCkgHRynYSQQFP6gJfBN5STFLY='
|
|
133
|
+
},
|
|
134
|
+
'url' => {
|
|
135
|
+
'css' => 'https://cdn.jsdelivr.net/npm/spotlight.js@{{version}}/dist/css/spotlight.min.css',
|
|
136
|
+
'js' => 'https://cdn.jsdelivr.net/npm/spotlight.js@{{version}}/dist/spotlight.bundle.min.js'
|
|
137
|
+
},
|
|
138
|
+
'version' => '0.7.8'
|
|
139
|
+
},
|
|
140
|
+
'venobox' => {
|
|
141
|
+
'integrity' => {
|
|
142
|
+
'css' => 'sha256-ohJEB0/WsBOdBD+gQO/MGfyJSbTUI8OOLbQGdkxD6Cg=',
|
|
143
|
+
'js' => 'sha256-LsGXHsHMMmTcz3KqTaWvLv6ome+7pRiic2LPnzTfiSo='
|
|
144
|
+
},
|
|
145
|
+
'url' => {
|
|
146
|
+
'css' => 'https://cdn.jsdelivr.net/npm/venobox@{{version}}/dist/venobox.min.css',
|
|
147
|
+
'js' => 'https://cdn.jsdelivr.net/npm/venobox@{{version}}/dist/venobox.min.js'
|
|
148
|
+
},
|
|
149
|
+
'version' => '2.1.8'
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
class BaseImageToolsTag < Liquid::Tag
|
|
154
|
+
private
|
|
155
|
+
|
|
156
|
+
def page_images(context)
|
|
157
|
+
page = context.registers[:page]
|
|
158
|
+
images = page && page['images']
|
|
159
|
+
images.is_a?(Hash) ? images : {}
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def base_url(context)
|
|
163
|
+
site = context['site']
|
|
164
|
+
site && site['baseurl'] ? site['baseurl'] : ''
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def medium_zoom_enabled?(context, images)
|
|
168
|
+
site = context['site']
|
|
169
|
+
site_enabled = site && site['enable_medium_zoom']
|
|
170
|
+
!!(site_enabled || images['medium_zoom'])
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def lightbox_enabled?(images)
|
|
174
|
+
!!(images['lightbox2'] || images['gallery'])
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
def asset_url(context, file_name)
|
|
178
|
+
"#{base_url(context)}/#{ASSETS_DIR}/#{PLUGIN_NAME}/#{JS_DIR}/#{file_name}"
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
def library_url(library, asset_type)
|
|
182
|
+
library_cfg = LIBRARIES[library]
|
|
183
|
+
return nil unless library_cfg
|
|
184
|
+
|
|
185
|
+
url = library_cfg.dig('url', asset_type)
|
|
186
|
+
return nil unless url
|
|
187
|
+
|
|
188
|
+
url.sub('{{version}}', library_cfg['version'])
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def library_integrity(library, asset_type)
|
|
192
|
+
LIBRARIES.dig(library, 'integrity', asset_type)
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
class ImageToolsStylesTag < BaseImageToolsTag
|
|
197
|
+
def render(context)
|
|
198
|
+
images = page_images(context)
|
|
199
|
+
output = []
|
|
200
|
+
|
|
201
|
+
if images['compare']
|
|
202
|
+
output << <<~HTML
|
|
203
|
+
<!-- Image comparison slider -->
|
|
204
|
+
<link
|
|
205
|
+
rel="stylesheet"
|
|
206
|
+
href="#{library_url('img-comparison-slider', 'css')}"
|
|
207
|
+
integrity="#{library_integrity('img-comparison-slider', 'css')}"
|
|
208
|
+
crossorigin="anonymous"
|
|
209
|
+
>
|
|
210
|
+
HTML
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if lightbox_enabled?(images)
|
|
214
|
+
output << <<~HTML
|
|
215
|
+
<!-- Lightbox2 -->
|
|
216
|
+
<link
|
|
217
|
+
rel="stylesheet"
|
|
218
|
+
href="#{library_url('lightbox2', 'css')}"
|
|
219
|
+
integrity="#{library_integrity('lightbox2', 'css')}"
|
|
220
|
+
crossorigin="anonymous"
|
|
221
|
+
>
|
|
222
|
+
HTML
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if images['photoswipe']
|
|
226
|
+
output << <<~HTML
|
|
227
|
+
<!-- PhotoSwipe -->
|
|
228
|
+
<link
|
|
229
|
+
rel="stylesheet"
|
|
230
|
+
href="#{library_url('photoswipe', 'css')}"
|
|
231
|
+
crossorigin="anonymous"
|
|
232
|
+
>
|
|
233
|
+
HTML
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if images['slider']
|
|
237
|
+
output << <<~HTML
|
|
238
|
+
<!-- Image slider -->
|
|
239
|
+
<link
|
|
240
|
+
rel="stylesheet"
|
|
241
|
+
href="#{library_url('swiper', 'css')}"
|
|
242
|
+
integrity="#{library_integrity('swiper', 'css')}"
|
|
243
|
+
crossorigin="anonymous"
|
|
244
|
+
>
|
|
245
|
+
HTML
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
if images['spotlight']
|
|
249
|
+
output << <<~HTML
|
|
250
|
+
<!-- Spotlight -->
|
|
251
|
+
<link
|
|
252
|
+
rel="stylesheet"
|
|
253
|
+
href="#{library_url('spotlight', 'css')}"
|
|
254
|
+
integrity="#{library_integrity('spotlight', 'css')}"
|
|
255
|
+
crossorigin="anonymous"
|
|
256
|
+
>
|
|
257
|
+
HTML
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if images['venobox']
|
|
261
|
+
output << <<~HTML
|
|
262
|
+
<!-- Venobox -->
|
|
263
|
+
<link
|
|
264
|
+
rel="stylesheet"
|
|
265
|
+
href="#{library_url('venobox', 'css')}"
|
|
266
|
+
integrity="#{library_integrity('venobox', 'css')}"
|
|
267
|
+
crossorigin="anonymous"
|
|
268
|
+
>
|
|
269
|
+
HTML
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
output.join("\n")
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
class ImageToolsScriptsTag < BaseImageToolsTag
|
|
277
|
+
def render(context)
|
|
278
|
+
images = page_images(context)
|
|
279
|
+
output = []
|
|
280
|
+
|
|
281
|
+
if medium_zoom_enabled?(context, images)
|
|
282
|
+
output << <<~HTML
|
|
283
|
+
<!-- Medium Zoom JS -->
|
|
284
|
+
<script
|
|
285
|
+
defer
|
|
286
|
+
src="#{library_url('medium_zoom', 'js')}"
|
|
287
|
+
integrity="#{library_integrity('medium_zoom', 'js')}"
|
|
288
|
+
crossorigin="anonymous"
|
|
289
|
+
></script>
|
|
290
|
+
<script defer src="#{asset_url(context, 'zoom.js')}"></script>
|
|
291
|
+
HTML
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
if images['compare']
|
|
295
|
+
output << <<~HTML
|
|
296
|
+
<script
|
|
297
|
+
defer
|
|
298
|
+
src="#{library_url('img-comparison-slider', 'js')}"
|
|
299
|
+
integrity="#{library_integrity('img-comparison-slider', 'js')}"
|
|
300
|
+
crossorigin="anonymous"
|
|
301
|
+
></script>
|
|
302
|
+
HTML
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
if lightbox_enabled?(images)
|
|
306
|
+
output << <<~HTML
|
|
307
|
+
<script
|
|
308
|
+
defer
|
|
309
|
+
src="#{library_url('lightbox2', 'js')}"
|
|
310
|
+
integrity="#{library_integrity('lightbox2', 'js')}"
|
|
311
|
+
crossorigin="anonymous"
|
|
312
|
+
></script>
|
|
313
|
+
HTML
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
if images['photoswipe']
|
|
317
|
+
output << <<~HTML
|
|
318
|
+
<script type="module">
|
|
319
|
+
import PhotoSwipeLightbox from "#{library_url('photoswipe-lightbox', 'js')}";
|
|
320
|
+
import PhotoSwipe from "#{library_url('photoswipe', 'js')}";
|
|
321
|
+
const photoswipe = new PhotoSwipeLightbox({
|
|
322
|
+
gallery: ".pswp-gallery",
|
|
323
|
+
children: "a",
|
|
324
|
+
pswpModule: PhotoSwipe,
|
|
325
|
+
});
|
|
326
|
+
photoswipe.init();
|
|
327
|
+
</script>
|
|
328
|
+
HTML
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
if images['slider']
|
|
332
|
+
output << <<~HTML
|
|
333
|
+
<script
|
|
334
|
+
defer
|
|
335
|
+
src="#{library_url('swiper', 'js')}"
|
|
336
|
+
integrity="#{library_integrity('swiper', 'js')}"
|
|
337
|
+
crossorigin="anonymous"
|
|
338
|
+
></script>
|
|
339
|
+
HTML
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
if images['spotlight']
|
|
343
|
+
output << <<~HTML
|
|
344
|
+
<script
|
|
345
|
+
defer
|
|
346
|
+
src="#{library_url('spotlight', 'js')}"
|
|
347
|
+
crossorigin="anonymous"
|
|
348
|
+
></script>
|
|
349
|
+
HTML
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
if images['venobox']
|
|
353
|
+
output << <<~HTML
|
|
354
|
+
<script
|
|
355
|
+
defer
|
|
356
|
+
src="#{library_url('venobox', 'js')}"
|
|
357
|
+
integrity="#{library_integrity('venobox', 'js')}"
|
|
358
|
+
crossorigin="anonymous"
|
|
359
|
+
></script>
|
|
360
|
+
<script defer src="#{asset_url(context, 'venobox-setup.js')}"></script>
|
|
361
|
+
HTML
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
output.join("\n")
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
Liquid::Template.register_tag('al_img_tools_styles', AlImgTools::ImageToolsStylesTag)
|
|
370
|
+
Liquid::Template.register_tag('al_img_tools_scripts', AlImgTools::ImageToolsScriptsTag)
|
metadata
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: al_img_tools
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- al-org
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-02-07 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: jekyll
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '3.9'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '5.0'
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '3.9'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '5.0'
|
|
33
|
+
- !ruby/object:Gem::Dependency
|
|
34
|
+
name: jekyll-3rd-party-libraries
|
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 0.0.1
|
|
40
|
+
type: :runtime
|
|
41
|
+
prerelease: false
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - "~>"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 0.0.1
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: bundler
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '2.0'
|
|
54
|
+
- - "<"
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '3.0'
|
|
57
|
+
type: :development
|
|
58
|
+
prerelease: false
|
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
60
|
+
requirements:
|
|
61
|
+
- - ">="
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '2.0'
|
|
64
|
+
- - "<"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '3.0'
|
|
67
|
+
- !ruby/object:Gem::Dependency
|
|
68
|
+
name: rake
|
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '13.0'
|
|
74
|
+
type: :development
|
|
75
|
+
prerelease: false
|
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - "~>"
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '13.0'
|
|
81
|
+
description: Jekyll plugin extracted from al-folio that provides image tool styles/scripts
|
|
82
|
+
for zoom, galleries, sliders, comparisons, and lightbox integrations.
|
|
83
|
+
email:
|
|
84
|
+
- dev@al-org.dev
|
|
85
|
+
executables: []
|
|
86
|
+
extensions: []
|
|
87
|
+
extra_rdoc_files: []
|
|
88
|
+
files:
|
|
89
|
+
- CHANGELOG.md
|
|
90
|
+
- LICENSE
|
|
91
|
+
- README.md
|
|
92
|
+
- lib/al_img_tools.rb
|
|
93
|
+
- lib/assets/al_img_tools/js/venobox-setup.js
|
|
94
|
+
- lib/assets/al_img_tools/js/zoom.js
|
|
95
|
+
homepage: https://github.com/al-org-dev/al-img-tools
|
|
96
|
+
licenses:
|
|
97
|
+
- MIT
|
|
98
|
+
metadata:
|
|
99
|
+
allowed_push_host: https://rubygems.org
|
|
100
|
+
homepage_uri: https://github.com/al-org-dev/al-img-tools
|
|
101
|
+
source_code_uri: https://github.com/al-org-dev/al-img-tools
|
|
102
|
+
post_install_message:
|
|
103
|
+
rdoc_options: []
|
|
104
|
+
require_paths:
|
|
105
|
+
- lib
|
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '2.7'
|
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
113
|
+
- - ">="
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '0'
|
|
116
|
+
requirements: []
|
|
117
|
+
rubygems_version: 3.0.3.1
|
|
118
|
+
signing_key:
|
|
119
|
+
specification_version: 4
|
|
120
|
+
summary: Image interaction tags and assets for Jekyll
|
|
121
|
+
test_files: []
|