m1key_gallery_generator 0.3.5 → 0.3.6
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 +4 -4
- data/README.md +3 -3
- data/lib/m1key_gallery_generator/photos_utils.rb +3 -2
- data/lib/m1key_gallery_generator/template.erb +45 -5
- data/lib/m1key_gallery_generator/version.rb +1 -1
- data/lib/m1key_gallery_generator/viewable_photo_metadata.rb +3 -2
- data/m1key_gallery_generator.gemspec +2 -1
- metadata +21 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38677a6a90da2674976377ac74f67f212c0fd7c20face68067e154aab5330fde
|
|
4
|
+
data.tar.gz: 36427c9ec3630094355cf29ef986c5adbef5ac1798fcfb58ba4b896fcd777737
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a01425db3764e28b6854bc299286b860897daa9504b03865b63d24a5accb7eec4737b9f33e21c8a8f5e661777fe1b67971138ce753b51968062e71e72cbdf6f
|
|
7
|
+
data.tar.gz: b3448310eb6cef7f2873337fafd3d535af160e880f407491fc16ce5a5f27b55a03612794ccc835dc315229d5d82cb68ab4c0eae58e4d143b9d6672fc3dad9ba4
|
data/README.md
CHANGED
|
@@ -74,11 +74,11 @@ Build the gem.
|
|
|
74
74
|
|
|
75
75
|
Install the gem.
|
|
76
76
|
|
|
77
|
-
> gem install m1key_gallery_generator-0.3.
|
|
77
|
+
> gem install m1key_gallery_generator-0.3.6.gem
|
|
78
78
|
|
|
79
79
|
In your gallery directory, have a file called generate.bat that looks like this:
|
|
80
80
|
|
|
81
|
-
> ruby c:\Ruby34-x64\lib\ruby\gems\3.4.0\gems\m1key_gallery_generator-0.3.
|
|
81
|
+
> ruby c:\Ruby34-x64\lib\ruby\gems\3.4.0\gems\m1key_gallery_generator-0.3.6\bin\console . wait_on_error
|
|
82
82
|
|
|
83
83
|
## Development
|
|
84
84
|
|
|
@@ -95,7 +95,7 @@ To build gem:
|
|
|
95
95
|
> gem build m1key_gallery_generator.gemspec
|
|
96
96
|
|
|
97
97
|
To install gem:
|
|
98
|
-
> gem install m1key_gallery_generator-0.3.
|
|
98
|
+
> gem install m1key_gallery_generator-0.3.6.gem
|
|
99
99
|
|
|
100
100
|
To test gem:
|
|
101
101
|
> irb
|
|
@@ -19,7 +19,7 @@ module GalleryGenerator
|
|
|
19
19
|
photo_technical_info = photo['technicalInfo']
|
|
20
20
|
photo_metadata = get_metadata_for_image_with_file_name_containing(working_directory, photo_file_name_contains)
|
|
21
21
|
|
|
22
|
-
puts "Adding photo with ID [#{photo_id}], title [#{photo_title}], height [#{photo_metadata.height}], description [#{compact(photo['description'])}]..."
|
|
22
|
+
puts "Adding photo with ID [#{photo_id}], title [#{photo_title}], width [#{photo_metadata.width}], height [#{photo_metadata.height}], description [#{compact(photo['description'])}]..."
|
|
23
23
|
photos.push ViewablePhoto.new(photo_id, photo_title, photo_description, photo_metadata, photo_technical_info)
|
|
24
24
|
|
|
25
25
|
create_gallery_image(photo_metadata.original_file_name, gallery_config.slug, photo_id, working_directory)
|
|
@@ -37,12 +37,13 @@ module GalleryGenerator
|
|
|
37
37
|
raise "ERROR No matching photo found for #{file_name_contains}." unless selected_file_name
|
|
38
38
|
|
|
39
39
|
exif = EXIFR::JPEG.new(File.join(working_directory, selected_file_name))
|
|
40
|
+
photo_width = exif.width
|
|
40
41
|
photo_height = exif.height
|
|
41
42
|
photo_iso = exif.iso_speed_ratings
|
|
42
43
|
photo_focal_length = exif.focal_length.to_f.round.to_s
|
|
43
44
|
photo_f_number = exif.f_number.to_f
|
|
44
45
|
photo_exposure_time = exif.exposure_time.to_s
|
|
45
|
-
ViewablePhotoMetadata.new(selected_file_name, photo_height, photo_iso, photo_focal_length, photo_f_number, photo_exposure_time)
|
|
46
|
+
ViewablePhotoMetadata.new(selected_file_name, photo_width, photo_height, photo_iso, photo_focal_length, photo_f_number, photo_exposure_time)
|
|
46
47
|
end
|
|
47
48
|
|
|
48
49
|
def create_gallery_image(original_file_name, gallery_slug, photo_id, working_directory)
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
10
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
11
|
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@800;900&display=swap" rel="stylesheet" />
|
|
12
|
+
<link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;500;600;700&display=swap"
|
|
13
|
+
rel="preload" as="style" />
|
|
12
14
|
<link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;500;600;700&display=swap"
|
|
13
15
|
rel="stylesheet" />
|
|
14
16
|
<link rel="stylesheet" href="../../styles/base_responsive.css" />
|
|
@@ -34,7 +36,14 @@
|
|
|
34
36
|
"@type": "ImageGallery",
|
|
35
37
|
"name": "<%= title %> by Michal Huniewicz",
|
|
36
38
|
"url": "https://www.m1key.me/photography/<%= slug %>",
|
|
39
|
+
"datePublished": "<%= upload_date %>",
|
|
40
|
+
"dateModified": "<%= upload_date %>",
|
|
37
41
|
"author": {
|
|
42
|
+
"@type": "Person",
|
|
43
|
+
"name": "Michal Huniewicz",
|
|
44
|
+
"url": "https://www.m1key.me/"
|
|
45
|
+
},
|
|
46
|
+
"publisher": {
|
|
38
47
|
"@type": "Person",
|
|
39
48
|
"name": "Michal Huniewicz"
|
|
40
49
|
},
|
|
@@ -42,11 +51,41 @@
|
|
|
42
51
|
{
|
|
43
52
|
"@type": "ImageObject",
|
|
44
53
|
"contentUrl" : "https://www.m1key.me/photography/<%= slug %>/<%= slug %>_<%= photo.id %>.jpg",
|
|
45
|
-
"caption": "<%= photo.title %>"
|
|
54
|
+
"caption": "<%= photo.title %>",
|
|
55
|
+
"width": "<%= photo.metadata.width %>",
|
|
56
|
+
"height": "<%= photo.metadata.height %>"
|
|
46
57
|
}<% if (index + 1) == photos.size %><% else %>,<% end -%>
|
|
47
58
|
<% end %>
|
|
48
59
|
],
|
|
49
|
-
"description": "<%= title %> — Photography and Art portfolio by Michal Huniewicz"
|
|
60
|
+
"description": "<%= title %> — Photography and Art portfolio by Michal Huniewicz",
|
|
61
|
+
"keywords": "photography, art, portfolio, Michal Huniewicz, m1key.me, <%= title %>"
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<script type="application/ld+json">
|
|
66
|
+
{
|
|
67
|
+
"@context": "https://schema.org",
|
|
68
|
+
"@type": "BreadcrumbList",
|
|
69
|
+
"itemListElement": [
|
|
70
|
+
{
|
|
71
|
+
"@type": "ListItem",
|
|
72
|
+
"position": 1,
|
|
73
|
+
"name": "M1key.me",
|
|
74
|
+
"item": "https://www.m1key.me/"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"@type": "ListItem",
|
|
78
|
+
"position": 2,
|
|
79
|
+
"name": "Photography",
|
|
80
|
+
"item": "https://www.m1key.me/photography/"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"@type": "ListItem",
|
|
84
|
+
"position": 3,
|
|
85
|
+
"name": "<%= title %>",
|
|
86
|
+
"item": "https://www.m1key.me/photography/<%= slug %>"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
50
89
|
}
|
|
51
90
|
</script>
|
|
52
91
|
</head>
|
|
@@ -81,13 +120,14 @@
|
|
|
81
120
|
</a>
|
|
82
121
|
<figcaption class="visually-hidden">Map showing <%= map_title %> location (opens in OpenStreetMap)</figcaption>
|
|
83
122
|
</figure>
|
|
84
|
-
<% photos.
|
|
123
|
+
<% photos.each_with_index do |photo, index| %>
|
|
85
124
|
<article class="photo" id="<%= photo.id %>">
|
|
86
125
|
<header>
|
|
87
126
|
<h2 class="title"><a href="#<%= photo.id %>" title="Link to this photo"><%= photo.title %></a></h2>
|
|
88
127
|
</header>
|
|
89
128
|
<figure class="image-container">
|
|
90
|
-
<img src="<%= slug %>_<%= photo.id %>.jpg" alt="<%= photo.title %>" loading="lazy"
|
|
129
|
+
<img src="<%= slug %>_<%= photo.id %>.jpg" alt="<%= photo.title %>" <% if index == 0 %>loading="eager" fetchpriority="high"<% else %>loading="lazy"<% end %>
|
|
130
|
+
width="<%= photo.metadata.width %>" height="<%= photo.metadata.height %>" />
|
|
91
131
|
<figcaption>
|
|
92
132
|
<span class="description"><%= photo.description %></span>
|
|
93
133
|
<span class="technical">ISO <%= photo.metadata.iso %>, <%= photo.metadata.focal_length %>mm, f/<%= photo.metadata.f_number %>, <%= photo.metadata.exposure_time %>s.<% if photo.technical_info.to_s != '' %> <%= photo.technical_info %><% end %></span>
|
|
@@ -96,7 +136,7 @@
|
|
|
96
136
|
</article>
|
|
97
137
|
<% end %>
|
|
98
138
|
<details class="sources" id="sources">
|
|
99
|
-
<summary
|
|
139
|
+
<summary>Sources</summary>
|
|
100
140
|
<ul class="smallprint"><% sources.each_with_index do |source, index| %>
|
|
101
141
|
<li><%= index + 1 %>: <a href="<%= source %>" rel="noopener noreferrer" class="nav-link"><%= source %></a></li><% end %>
|
|
102
142
|
</ul>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
module GalleryGenerator
|
|
2
2
|
class ViewablePhotoMetadata
|
|
3
|
-
attr_reader :original_file_name, :height, :iso, :focal_length, :f_number, :exposure_time
|
|
4
|
-
def initialize(original_file_name, height, iso, focal_length, f_number, exposure_time)
|
|
3
|
+
attr_reader :original_file_name, :width, :height, :iso, :focal_length, :f_number, :exposure_time
|
|
4
|
+
def initialize(original_file_name, width, height, iso, focal_length, f_number, exposure_time)
|
|
5
5
|
@original_file_name = original_file_name
|
|
6
|
+
@width = width
|
|
6
7
|
@height = height
|
|
7
8
|
@iso = iso
|
|
8
9
|
@focal_length = focal_length
|
|
@@ -23,8 +23,9 @@ Gem::Specification.new do |spec|
|
|
|
23
23
|
|
|
24
24
|
spec.add_runtime_dependency 'exifr', '~> 1.4', '>= 1.4.0'
|
|
25
25
|
|
|
26
|
-
spec.add_development_dependency 'bundler', '>= 2.4.10'
|
|
26
|
+
spec.add_development_dependency 'bundler', '~> 2.4', '>= 2.4.10'
|
|
27
27
|
spec.add_development_dependency 'rake', '~> 13.0'
|
|
28
28
|
spec.add_development_dependency 'minitest', '~> 5.15'
|
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.13'
|
|
30
|
+
spec.add_development_dependency 'fiddle', '~> 1.1.8'
|
|
30
31
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: m1key_gallery_generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michal Huniewicz
|
|
@@ -33,6 +33,9 @@ dependencies:
|
|
|
33
33
|
name: bundler
|
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
|
35
35
|
requirements:
|
|
36
|
+
- - "~>"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '2.4'
|
|
36
39
|
- - ">="
|
|
37
40
|
- !ruby/object:Gem::Version
|
|
38
41
|
version: 2.4.10
|
|
@@ -40,6 +43,9 @@ dependencies:
|
|
|
40
43
|
prerelease: false
|
|
41
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
42
45
|
requirements:
|
|
46
|
+
- - "~>"
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '2.4'
|
|
43
49
|
- - ">="
|
|
44
50
|
- !ruby/object:Gem::Version
|
|
45
51
|
version: 2.4.10
|
|
@@ -85,6 +91,20 @@ dependencies:
|
|
|
85
91
|
- - "~>"
|
|
86
92
|
- !ruby/object:Gem::Version
|
|
87
93
|
version: '3.13'
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: fiddle
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - "~>"
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: 1.1.8
|
|
101
|
+
type: :development
|
|
102
|
+
prerelease: false
|
|
103
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - "~>"
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: 1.1.8
|
|
88
108
|
description: This gem allows you to generate a m1key.me-style gallery based on the
|
|
89
109
|
JPG files in the working directory.
|
|
90
110
|
email:
|