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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e85ed518997ec0e6931b95c178fc83ba6c423341ee479b85fee4c1f4b0bbaa08
4
- data.tar.gz: 540be0f7cb57bfe802812dc6c3e1db10b7911976c32a0572abaa8c1e95fbe1af
3
+ metadata.gz: 05d235704b099fe3023235fb4797174a87f9e1d49e51c82d397ac9d697d68f17
4
+ data.tar.gz: 4b48165a07d9f74543611812d132a49ee125e82dfd989b4b370f7d2f9625b0f9
5
5
  SHA512:
6
- metadata.gz: 8a728a3efafe4cc10a1dc06998977d1f943d592cb8bc30d3bcf5e699df92e7b0fc7f3ac4af39700e41e40a885b97a7a9284aebdcb76ad03f7fcc042798cf9c8a
7
- data.tar.gz: 6f26a4af3597fdc4d7d183d47473001384bcfd6f3aada810cefb9357ace326d44acf31619702c5e6a43d2d1850de18ef1c03d9470bd4eea6d4e1745bf10a1bd6
6
+ metadata.gz: 921f81bc1fa1760118cd40a5f713f53e4fae917a7692b0fe23606c534c1ec0e9e45ff61c7a42b915fed5f4ee711a1808e806d8591f930081cbec5c45af54a706
7
+ data.tar.gz: b9dd3ccbb742348847eafd97a134b26f8982f4c2da4c0cc935ee0fdf8ce1e74025b2af9e34c2fcd25dda9e9fcb80ed712be1ea1e8d8eed5257770f5c2b632e00
data/gem.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
 
33
33
 
34
34
 
35
- spec.add_dependency "jekyll", "~>4.0.0"
35
+ spec.add_dependency "jekyll", "~>4.0"
36
36
  spec.add_dependency "ltec", "~> 0.1.2"
37
37
  spec.add_dependency "salsa20", "~> 0.1.3"
38
38
  spec.add_dependency "digest"
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoStylePlease2
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
data/test.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require "ltec"
3
- require "nostyleplease2plugins"
2
+ # require "ltec"
3
+ # require "nostyleplease2plugins"
4
4
 
5
- Jekyll::test
6
-
5
+ # Jekyll::test
6
+
7
+ a = '12-3'
8
+ b = a.split(' ',2)
9
+ print b
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.1
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-21 00:00:00.000000000 Z
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.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.0
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ltec
29
29
  requirement: !ruby/object:Gem::Requirement