no-style-please2-plugins 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gem.gemspec +1 -1
- data/lib/ext.rb +34 -1
- data/lib/version/version.rb +1 -1
- data/test.rb +7 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05d235704b099fe3023235fb4797174a87f9e1d49e51c82d397ac9d697d68f17
|
4
|
+
data.tar.gz: 4b48165a07d9f74543611812d132a49ee125e82dfd989b4b370f7d2f9625b0f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 921f81bc1fa1760118cd40a5f713f53e4fae917a7692b0fe23606c534c1ec0e9e45ff61c7a42b915fed5f4ee711a1808e806d8591f930081cbec5c45af54a706
|
7
|
+
data.tar.gz: b9dd3ccbb742348847eafd97a134b26f8982f4c2da4c0cc935ee0fdf8ce1e74025b2af9e34c2fcd25dda9e9fcb80ed712be1ea1e8d8eed5257770f5c2b632e00
|
data/gem.gemspec
CHANGED
data/lib/ext.rb
CHANGED
@@ -47,6 +47,37 @@ module Jekyll
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
class ImgLink < Liquid::Tag
|
51
|
+
|
52
|
+
|
53
|
+
def initialize(tag_name, text, tokens)
|
54
|
+
arr = text.strip.split(' ',2)
|
55
|
+
if arr.count == 2
|
56
|
+
@img_name = arr[1]
|
57
|
+
@title = arr[0]
|
58
|
+
else
|
59
|
+
@img_name = arr[0]
|
60
|
+
@title = "img_link"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def render(context)
|
65
|
+
path = context['page']['path']
|
66
|
+
|
67
|
+
|
68
|
+
dirPath0 = path[0...(path.length - 3)]
|
69
|
+
pathComponent = dirPath0.split("/")
|
70
|
+
dirPath = pathComponent[-1]
|
71
|
+
|
72
|
+
base = $g_config['baseurl']
|
73
|
+
link = "/pics/#{dirPath}/#{@img_name}"
|
74
|
+
if base && base.length
|
75
|
+
link = "#{base}/pics/#{dirPath}/#{@img_name}"
|
76
|
+
end
|
77
|
+
return "[#{@title}](#{link})"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
50
81
|
$g_title_link ||= {}
|
51
82
|
LOADINGFLG = :LOADINGFLG
|
52
83
|
|
@@ -78,7 +109,6 @@ module Jekyll
|
|
78
109
|
end
|
79
110
|
end
|
80
111
|
end
|
81
|
-
|
82
112
|
|
83
113
|
|
84
114
|
class IncludeCode < Liquid::Tag
|
@@ -117,6 +147,9 @@ EOF
|
|
117
147
|
Liquid::Template.register_tag('asset_img', Jekyll::AssetImg)
|
118
148
|
Liquid::Template.register_tag('include_code', Jekyll::IncludeCode)
|
119
149
|
Liquid::Template.register_tag('post_link', Jekyll::PostLink)
|
150
|
+
Liquid::Template.register_tag('img_link', Jekyll::ImgLink)
|
151
|
+
|
152
|
+
|
120
153
|
|
121
154
|
|
122
155
|
|
data/lib/version/version.rb
CHANGED
data/test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: no-style-please2-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vitock
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ltec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|