jekyll-shorts 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/cli.feature +37 -0
- data/jekyll-shorts.gemspec +1 -1
- data/lib/jekyll-shorts/generator.rb +2 -2
- data/lib/jekyll-shorts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075333a0c5c258bde795e1bbf517d836e05c704f30036a7781fd0d88873acb6b
|
4
|
+
data.tar.gz: 8d19ee30aa6547623b58b6b230b44fbf0952e83b034a40a1d856fec05b660e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72f406ff8aabaede20f7203853c76a9d8d4809b82d1b93e4414784f69a331bfee308f18a951526e7e1260e8477c6f5a0c5435cc0c56709327f5f533a930e8fd
|
7
|
+
data.tar.gz: bb12ffc8a185eb2bb4de450434015d86761786daa2da87fe16ed689842aaf70046e7833d4809fcc8557a59c2ff9d8ffdab064be9425df7c57c48effc4bd1f925
|
data/features/cli.feature
CHANGED
@@ -25,3 +25,40 @@ Feature: Simple site building
|
|
25
25
|
Then I build Jekyll site
|
26
26
|
And Exit code is zero
|
27
27
|
And File "_site/230729.html" exists
|
28
|
+
And I build Jekyll site
|
29
|
+
And Exit code is zero
|
30
|
+
|
31
|
+
Scenario: Simple site
|
32
|
+
Given I have a "_config.yml" file with content:
|
33
|
+
"""
|
34
|
+
markdown: kramdown
|
35
|
+
plugins:
|
36
|
+
- jekyll-shorts
|
37
|
+
shorts:
|
38
|
+
permalink: :y.html
|
39
|
+
"""
|
40
|
+
And I have a "_layouts/default.html" file with content:
|
41
|
+
"""
|
42
|
+
{{ content }}
|
43
|
+
"""
|
44
|
+
And I have a "_posts/2023-01-01-hello.md" file with content:
|
45
|
+
"""
|
46
|
+
---
|
47
|
+
title: Hello, world!
|
48
|
+
layout: default
|
49
|
+
---
|
50
|
+
Hello, world!
|
51
|
+
"""
|
52
|
+
Then I build Jekyll site
|
53
|
+
And Exit code is zero
|
54
|
+
And File "_site/23.html" exists
|
55
|
+
And I have a "_posts/2023-02-02-hello.md" file with content:
|
56
|
+
"""
|
57
|
+
---
|
58
|
+
title: Hello, world!
|
59
|
+
layout: default
|
60
|
+
---
|
61
|
+
Hello, world!
|
62
|
+
"""
|
63
|
+
And I build Jekyll site
|
64
|
+
And Exit code is not zero
|
data/jekyll-shorts.gemspec
CHANGED
@@ -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.
|
31
|
+
s.version = '0.0.5'
|
32
32
|
s.license = 'MIT'
|
33
33
|
s.summary = 'Automatically generates short links for Jekyll website'
|
34
34
|
s.description = [
|
@@ -79,10 +79,10 @@ class JekyllShorts::Generator < Jekyll::Generator
|
|
79
79
|
<meta http-equiv='refresh' content='#{@long}'/></head></html>"
|
80
80
|
if File.exist?(path)
|
81
81
|
before = File.read(path)
|
82
|
-
if before !=
|
82
|
+
if before != html
|
83
83
|
raise "It's impossible to generate a short link at #{path.inspect}, \
|
84
84
|
because the file already exists and the content \
|
85
|
-
of the it differs from what we are going to write into it now (#{long}). This most \
|
85
|
+
of the it differs from what we are going to write into it now (#{@long}). This most \
|
86
86
|
probably means that previously generated short link will point to a different location \
|
87
87
|
than before. Try to run 'jekyll clean', it will help, if you know what you are doing."
|
88
88
|
end
|