jekyll-shorts 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0865d5612007eb2f21897da52685a97e6555f305a34546f43541a7710349028
4
- data.tar.gz: e0555698b8f494dbd5f8f77bb1d6974aebac77ef91deef65db05ecf53877ea71
3
+ metadata.gz: 5274421350720698e2b1b121d2b1172e7353ed3ee272448a0f4770ce1de2cb9c
4
+ data.tar.gz: 438e0496e14abf79ac5a528f612b9063eb5eaada237c8b2a242f9420b4cc06c9
5
5
  SHA512:
6
- metadata.gz: 99e93ff62eb54a5b88d7ce55dc94f662db5ea3956bd8fdf2d18990e4bb87f498e4a3ef991ab585a5aa08f55c89856d707013f0b2f24489ab5937250788db9116
7
- data.tar.gz: ee1717e2a2b55080afd0b6ffba8740bcb5d29aa12e4b5a731b57c59424f6fe356b611d980ba8b6c0de3e9d708d7cda15fd7076de152867a3eecb9fa152d0994a
6
+ metadata.gz: 9a002a9b9801913f4d69244374d23dc2c2516ce007e61fc60714822fff0e3f5d5e4c7c58b0cda3beeb29e2b21831e1c553f7aa98c2abe5216f066769e2b974e6
7
+ data.tar.gz: 3b31fad918a945d95a5a139d3a2a003563c0ee89a9884ee9c0f9f734a460df37f584676589b386f045b96792bc868124f71da66fcd125e6f9696adb7cabcdf43
data/README.md CHANGED
@@ -29,7 +29,7 @@ Here, every page in the site will get a sibling with the name
29
29
  * `:month` - the month of the post, like `01` or `12`
30
30
  * `:day` - the day of the post, like `07` or `29`
31
31
  * `:position` - the unique position of the post in the entire list of them, like `42` or `256`
32
- * `:letter` - one English letter inside a month
32
+ * `:letter` - one English letter inside a month (empty instead of `a`)
33
33
 
34
34
  Be careful with the `:position`, since it may change when you add a new post
35
35
  somewhere in the middle of existing flow of posts.
data/features/cli.feature CHANGED
@@ -96,5 +96,5 @@ Feature: Simple site building
96
96
  """
97
97
  And I build Jekyll site
98
98
  And Exit code is zero
99
- And File "_site/2301a.html" exists
99
+ And File "_site/2301.html" exists
100
100
  And File "_site/2301b.html" exists
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
29
29
  s.required_ruby_version = '>= 2.6'
30
30
  s.name = 'jekyll-shorts'
31
- s.version = '0.0.6'
31
+ s.version = '0.0.7'
32
32
  s.license = 'MIT'
33
33
  s.summary = 'Automatically generates short links for Jekyll website'
34
34
  s.description = [
@@ -50,13 +50,14 @@ class JekyllShorts::Generator < Jekyll::Generator
50
50
  long = doc.url
51
51
  month = doc.date.strftime('%Y%m')
52
52
  months[month] = 0 if months[month].nil?
53
+ raise 'Too many letters' if months[month] >= 26
53
54
  short = Jekyll::URL.new(
54
55
  template: permalink,
55
56
  placeholders: {
56
57
  'year' => doc.date.year.to_s[2..],
57
58
  'month' => doc.date.month.to_s.rjust(2, '0'),
58
59
  'day' => doc.date.day.to_s.rjust(2, '0'),
59
- 'letter' => (months[month] + 'a'.ord).chr,
60
+ 'letter' => months[month].zero? ? '' : (months[month] + 'a'.ord).chr,
60
61
  'position' => pos.to_s
61
62
  }
62
63
  ).to_s
@@ -23,5 +23,5 @@
23
23
  # SOFTWARE.
24
24
 
25
25
  module JekyllShorts
26
- VERSION = '0.0.6'
26
+ VERSION = '0.0.7'
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-shorts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko