no-style-please2-plugins 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -5
  3. data/lib/ext.rb +14 -2
  4. data/lib/version/version.rb +1 -1
  5. data/test.rb +12 -3
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05d235704b099fe3023235fb4797174a87f9e1d49e51c82d397ac9d697d68f17
4
- data.tar.gz: 4b48165a07d9f74543611812d132a49ee125e82dfd989b4b370f7d2f9625b0f9
3
+ metadata.gz: e9f4f4a41d85064307365636096162753cb141b2832a40825c7aa90f38ee399c
4
+ data.tar.gz: 87a751e6931d4a02d7c995eb026f8b8d2a9f81a532a842a7ddbfa1ca4ca4a73a
5
5
  SHA512:
6
- metadata.gz: 921f81bc1fa1760118cd40a5f713f53e4fae917a7692b0fe23606c534c1ec0e9e45ff61c7a42b915fed5f4ee711a1808e806d8591f930081cbec5c45af54a706
7
- data.tar.gz: b9dd3ccbb742348847eafd97a134b26f8982f4c2da4c0cc935ee0fdf8ce1e74025b2af9e34c2fcd25dda9e9fcb80ed712be1ea1e8d8eed5257770f5c2b632e00
6
+ metadata.gz: d373db5377ec0dc015cab2fb94cfd14d2695e970089a062bc73741f9e2119cb40e55b465071b68713fc50047b471ba0857509822ed15e4f3337bb60f35190b38
7
+ data.tar.gz: 944d77a182c0644d635d89e0e8ab083a4a3a72b54b80e32aa711ea08fe7f805a09a6ff4bf14e74c0de8753f783cef7cf0dd123ae28b4526a98773b76195951a3
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
- # No::Style::Please2::Plugins
2
1
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/no/style/please2/plugins`. To experiment with that code, run `bin/console` for an interactive prompt.
2
+ this is jekyll plugin for no-style-please2 theme
4
3
 
5
- TODO: Delete this and the text above, and describe your gem
4
+ ## Feature
5
+ + tag support, this plugin will create tag page if you add tags in your post
6
+ + liquid tags
7
+ + post_link ,link to post via title
8
+ + img_link ,link to a image
9
+ + asset_img insert a picture into the post content
10
+ + encryption support. encrypt the post content. you can set password for tag, or set a password in the post front matter. password will be encrypted by ECC cryption.
6
11
 
7
12
  ## Installation
8
13
 
@@ -16,7 +21,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
21
 
17
22
  ## Usage
18
23
 
19
- TODO: Write usage instructions here
24
+ see this [demo](https://vitock.ink/no-style-please-demo/)
20
25
 
21
26
  ## Development
22
27
 
@@ -26,4 +31,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
31
 
27
32
  ## Contributing
28
33
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/no-style-please2-plugins.
34
+ Bug reports and pull requests are welcome on GitHub at https://github.com/vitock/no-style-please2-plugins.
data/lib/ext.rb CHANGED
@@ -27,7 +27,12 @@ module Jekyll
27
27
 
28
28
 
29
29
  def initialize(tag_name, text, tokens)
30
- @img_name = text.strip
30
+ arr = text.strip.split(" ")
31
+ @img_name = arr[0]
32
+ @img_width = nil
33
+ if arr.count > 1
34
+ @img_width = arr[1]
35
+ end
31
36
  end
32
37
 
33
38
  def render(context)
@@ -43,7 +48,14 @@ module Jekyll
43
48
  if base && base.length
44
49
  link = "#{base}/pics/#{dirPath}/#{@img_name}"
45
50
  end
46
- return "![](#{link})"
51
+
52
+ if @img_width != nil
53
+ return "<img src='#{link}' style='width:#{@img_width}px'>"
54
+ else
55
+ return "![](#{link})"
56
+ end
57
+
58
+
47
59
  end
48
60
  end
49
61
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoStylePlease2
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
data/test.rb CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  # Jekyll::test
6
6
 
7
- a = '12-3'
8
- b = a.split(' ',2)
9
- print b
7
+ a = '12-3 a 3 3'
8
+ b = a.split('x')
9
+ z = nil;
10
+ if z
11
+ puts 333
12
+ else
13
+ puts 44
14
+ end
15
+ puts b
16
+ puts b[0]
17
+ z = 333
18
+ puts "<img src='#{z}' style='width:#{z}px'>"
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.2
4
+ version: 0.4.3
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-30 00:00:00.000000000 Z
11
+ date: 2022-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll