m1key_gallery_generator 0.3.6 → 0.3.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38677a6a90da2674976377ac74f67f212c0fd7c20face68067e154aab5330fde
4
- data.tar.gz: 36427c9ec3630094355cf29ef986c5adbef5ac1798fcfb58ba4b896fcd777737
3
+ metadata.gz: adc553b9cc6d516831f8013922a725efec39124c421eab37b26657da3353dd6a
4
+ data.tar.gz: 6c0391edc647d872df0d877b9071678f324b35ec52f267d01dd8a7a8c3902dcb
5
5
  SHA512:
6
- metadata.gz: 6a01425db3764e28b6854bc299286b860897daa9504b03865b63d24a5accb7eec4737b9f33e21c8a8f5e661777fe1b67971138ce753b51968062e71e72cbdf6f
7
- data.tar.gz: b3448310eb6cef7f2873337fafd3d535af160e880f407491fc16ce5a5f27b55a03612794ccc835dc315229d5d82cb68ab4c0eae58e4d143b9d6672fc3dad9ba4
6
+ metadata.gz: 6fe8d82b5187d4511a773aad9c153603838caadfb5e572b79766e7ee3ff38b4130aa4eeb75e38e0c7685e89e98ff6169b6f50aca996191caf89bb348297d02b1
7
+ data.tar.gz: aa17a99e8ec793d444e7557c36cc995c24f00e1b5c7874ff0cf73447d5997b1d6ce30f8b89ed438a7bb69a842f8d7708f108c0110dc42038b96cdd4c48fd91d0
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.6.gem
77
+ > gem install m1key_gallery_generator-0.3.9.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.6\bin\console . wait_on_error
81
+ > ruby c:\Ruby34-x64\lib\ruby\gems\3.4.0\gems\m1key_gallery_generator-0.3.9\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.6.gem
98
+ > gem install m1key_gallery_generator-0.3.9.gem
99
99
 
100
100
  To test gem:
101
101
  > irb
data/bin/console CHANGED
@@ -31,7 +31,7 @@ begin
31
31
 
32
32
  gallery = ViewableGallery.new(gallery_config.title, gallery_config.description, gallery_config.slug,
33
33
  gallery_config.sources, gallery_config.upload_date, gallery_config.map_url, gallery_config.map_title,
34
- gallery_config.year, viewable_photos, gallery_config.small_print).
34
+ gallery_config.year, viewable_photos, gallery_config.small_print, gallery_config.blurb).
35
35
  update_using(
36
36
  add_tabs_before_every_description_line(3),
37
37
  add_links_to_descriptions,
@@ -5,7 +5,7 @@ require_relative 'console_utils'
5
5
  module GalleryGenerator
6
6
  class GalleryConfig
7
7
 
8
- attr_reader :title, :map_url, :map_title, :slug, :upload_date, :description, :sources, :year, :photos, :small_print
8
+ attr_reader :title, :map_url, :map_title, :slug, :upload_date, :description, :sources, :year, :photos, :small_print, :blurb
9
9
 
10
10
  def initialize(yaml_config_file_name)
11
11
  puts "Attempting to parse #{yaml_config_file_name} to read gallery configuration..."
@@ -27,6 +27,8 @@ module GalleryGenerator
27
27
  puts "Gallery description is [#{compact(@description)}]."
28
28
  @small_print = gallery_configuration['small_print']
29
29
  puts "Small print is [#{@small_print}]."
30
+ @blurb = gallery_configuration['blurb']
31
+ puts "Gallery description is [#{compact(@blurb)}]."
30
32
 
31
33
  @sources = gallery_configuration['sources']
32
34
 
@@ -5,9 +5,12 @@
5
5
  <meta charset="utf-8" />
6
6
  <meta name="viewport" content="width=device-width,initial-scale=1" />
7
7
  <title><%= title %> &mdash; Photography and Art Portfolio by Michal Huniewicz</title>
8
- <meta name="description" content="<%= title %> &mdash; Photography and art portfolio by Michal Huniewicz" />
8
+ <meta name="description" content="<%= blurb %>" />
9
+ <link rel="canonical" href="https://www.m1key.me/photography/<%= slug %>" />
9
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
10
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="dns-prefetch" href="https://fonts.googleapis.com" />
13
+ <link rel="dns-prefetch" href="https://fonts.gstatic.com" />
11
14
  <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@800;900&display=swap" rel="stylesheet" />
12
15
  <link href="https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;500;600;700&display=swap"
13
16
  rel="preload" as="style" />
@@ -19,14 +22,14 @@
19
22
  <meta property="og:locale" content="en_US" />
20
23
  <meta property="og:type" content="website" />
21
24
  <meta property="og:title" content="<%= title %> by Michal Huniewicz" />
22
- <meta property="og:description" content="<%= title %> &mdash; Photography and Art portfolio by Michal Huniewicz" />
23
- <meta property="og:url" content="https://www.m1key.me/" />
25
+ <meta property="og:description" content="<%= blurb %>" />
26
+ <meta property="og:url" content="https://www.m1key.me/photography/<%= slug %>" />
24
27
  <meta property="og:image" content="https://www.m1key.me/photography/<%= slug %>/<%= slug %>_01.jpg" />
25
28
  <meta property="og:image:alt" content="<%= title %> by Michal Huniewicz" />
26
29
 
27
30
  <meta name="twitter:card" content="summary_large_image" />
28
31
  <meta name="twitter:title" content="<%= title %> by Michal Huniewicz" />
29
- <meta name="twitter:description" content="<%= title %> &mdash; Photography and Art portfolio by Michal Huniewicz" />
32
+ <meta name="twitter:description" content="<%= blurb %>" />
30
33
  <meta name="twitter:image" content="https://www.m1key.me/photography/<%= slug %>/<%= slug %>_01.jpg" />
31
34
 
32
35
  <!-- Breadcrumb structured data for SEO -->
@@ -52,12 +55,12 @@
52
55
  "@type": "ImageObject",
53
56
  "contentUrl" : "https://www.m1key.me/photography/<%= slug %>/<%= slug %>_<%= photo.id %>.jpg",
54
57
  "caption": "<%= photo.title %>",
55
- "width": "<%= photo.metadata.width %>",
56
- "height": "<%= photo.metadata.height %>"
58
+ "width": <%= photo.metadata.width %>,
59
+ "height": <%= photo.metadata.height %>
57
60
  }<% if (index + 1) == photos.size %><% else %>,<% end -%>
58
61
  <% end %>
59
62
  ],
60
- "description": "<%= title %> &mdash; Photography and Art portfolio by Michal Huniewicz",
63
+ "description": "<%= blurb %>",
61
64
  "keywords": "photography, art, portfolio, Michal Huniewicz, m1key.me, <%= title %>"
62
65
  }
63
66
  </script>
@@ -70,7 +73,7 @@
70
73
  {
71
74
  "@type": "ListItem",
72
75
  "position": 1,
73
- "name": "M1key.me",
76
+ "name": "Home",
74
77
  "item": "https://www.m1key.me/"
75
78
  },
76
79
  {
@@ -138,7 +141,7 @@
138
141
  <details class="sources" id="sources">
139
142
  <summary>Sources</summary>
140
143
  <ul class="smallprint"><% sources.each_with_index do |source, index| %>
141
- <li><%= index + 1 %>: <a href="<%= source %>" rel="noopener noreferrer" class="nav-link"><%= source %></a></li><% end %>
144
+ <li><%= index + 1 %>: <a href="<%= source %>" rel="noopener noreferrer" class="nav-link"><% if source.length > 100 %><%= source[0..50] %>[...]<%= source[-30..-1] %><% else %><%= source %><% end -%></a></li><% end %>
142
145
  </ul>
143
146
  </details>
144
147
 
@@ -158,7 +161,7 @@
158
161
  <li><a href="https://www.m1key.me" class="nav-link">M1key.me</a></li>
159
162
  <li><a href="https://www.m1key.me/photography/" class="nav-link">Photography</a></li>
160
163
  <li><a href="https://www.m1key.me/about_me/" class="nav-link">About me</a></li>
161
- <li><a href="https://www.flickr.com/photos/m1key-me/" rel="noopener noreferrer" class="nav-link">Flickr</a></li>
164
+ <li><a href="https://www.flickr.com/photos/m1key-me/" target="_blank" rel="noopener noreferrer" class="nav-link">Flickr</a></li>
162
165
  </ul>
163
166
  </nav>
164
167
 
@@ -1,3 +1,3 @@
1
1
  module M1keyGalleryGenerator
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.9'
3
3
  end
@@ -2,8 +2,8 @@ require_relative 'string_utils'
2
2
 
3
3
  module GalleryGenerator
4
4
  class ViewableGallery
5
- attr_reader :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print
6
- def initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print)
5
+ attr_reader :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb
6
+ def initialize(title, description, slug, sources, upload_date, map_url, map_title, year, viewable_photos, small_print, blurb)
7
7
  @title = String.new(title)
8
8
  @description = description
9
9
  @slug = slug
@@ -14,6 +14,7 @@ module GalleryGenerator
14
14
  @year = year
15
15
  @photos = viewable_photos
16
16
  @small_print = small_print
17
+ @blurb = blurb
17
18
  end
18
19
 
19
20
  def get_binding
@@ -29,7 +30,7 @@ module GalleryGenerator
29
30
 
30
31
  ViewableGallery.new(updated_gallery.title, updated_gallery.description, updated_gallery.slug,
31
32
  updated_gallery.sources, updated_gallery.upload_date, updated_gallery.map_url,
32
- updated_gallery.map_title, updated_gallery.year, to_viewable_photos(updated_gallery.photos), updated_gallery.small_print)
33
+ updated_gallery.map_title, updated_gallery.year, to_viewable_photos(updated_gallery.photos), updated_gallery.small_print, updated_gallery.blurb)
33
34
  end
34
35
 
35
36
  def to_viewable_photos(mutable_viewable_photos)
@@ -41,7 +42,7 @@ module GalleryGenerator
41
42
  end
42
43
 
43
44
  class MutableViewableGallery
44
- attr_accessor :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print
45
+ attr_accessor :title, :description, :slug, :sources, :upload_date, :map_url, :map_title, :year, :photos, :small_print, :blurb
45
46
  def initialize(viewable_gallery)
46
47
  @title = viewable_gallery.title
47
48
  @description = viewable_gallery.description
@@ -53,6 +54,7 @@ module GalleryGenerator
53
54
  @year = viewable_gallery.year
54
55
  @photos = to_mutable_viewable_photos(viewable_gallery.photos)
55
56
  @small_print = viewable_gallery.small_print
57
+ @blurb = viewable_gallery.blurb
56
58
  end
57
59
 
58
60
  def to_mutable_viewable_photos(viewable_photos)
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.6
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Huniewicz