no-style-please2-plugins 0.1.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f697e578e78801a1d3f0e5013a647c7586abf3cdd1b6f3370c14da5caae17ab
4
- data.tar.gz: f1fa9322abc159f691a192d7771b1d85ebd253baa549851f56cac89cc7f3f562
3
+ metadata.gz: c6c2729c6550b4087c31afa6e37a8df725ff60860e50a60523b4e7aee9fd0250
4
+ data.tar.gz: b3f5a6ae7e93d8f6aec5ebd78018fe9e9b1b085f29fde27864167c7f6252330d
5
5
  SHA512:
6
- metadata.gz: f82df9bd1d9e8a9e970985b82b3aebee697cb55a92edd2cc7bce892020893260e0176f57abd7a0595bd67ebdc1157d4cf74bfaf88d7b114b48fddce6da48c536
7
- data.tar.gz: b03bc3362a52b6b956635450081a78ae7e19e904f28c8b6d770ceb8522685f9f0d1fcab7112b48cf262bf70a1f5cd504abad52bc4660d0f59fb5081fb819f755
6
+ metadata.gz: cd4bab44536fb9845e6eb84b44624c01fb9b996fe114e8e4d63d52ec3f9d54749e46bd9e493b557054a789cb80b44cb4376a329e5f39178b2beb5998781479d2
7
+ data.tar.gz: 685e211ee26eee1f789d5029e5b2f098eb385f448075c43cacacebc34264b2b2a6e7b117be08701a10a94513ff551be6c5627966df0fbc94cd3483cd5ed06375
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- no-style-please2-plugins (0.1.1)
4
+ no-style-please2-plugins (0.2.0)
5
5
  digest
6
6
  jekyll (~> 4.2.0)
7
7
  ltec (~> 0.1.2)
data/gem.gemspec CHANGED
@@ -3,7 +3,6 @@
3
3
  require_relative "lib/version/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- # nostyleplease2plugins is too long?
7
6
  spec.name = "no-style-please2-plugins"
8
7
  spec.version = NoStylePlease2::VERSION
9
8
  spec.authors = ["vitock"]
@@ -33,7 +32,7 @@ Gem::Specification.new do |spec|
33
32
 
34
33
 
35
34
 
36
- spec.add_runtime_dependency "jekyll", "~> 4.2.0"
35
+ spec.add_dependency "jekyll", "~>4.2.0"
37
36
  spec.add_dependency "ltec", "~> 0.1.2"
38
37
  spec.add_dependency "salsa20", "~> 0.1.3"
39
38
  spec.add_dependency "digest"
data/lib/enc.rb CHANGED
@@ -5,6 +5,9 @@ require 'digest'
5
5
  require 'ltec'
6
6
  require "jekyll"
7
7
  module Jekyll
8
+ def test
9
+ puts 333
10
+ end
8
11
  module EncFilter
9
12
  def getKey(content,page)
10
13
  site = Jekyll::sites[0]
@@ -60,8 +63,9 @@ module Jekyll
60
63
  return r ? "1":""
61
64
  end
62
65
 
63
- def contentEncrypt(content,page)
66
+ def contentEncrypt(content,page,prefix)
64
67
  keyOri = getKey(content,page)
68
+ keyOri = prefix + keyOri + prefix
65
69
  key = Digest::MD5.hexdigest(keyOri).downcase()
66
70
  iv = Digest::MD5.hexdigest(content).downcase()
67
71
  ivHex = iv[0...16]
@@ -73,7 +77,7 @@ module Jekyll
73
77
 
74
78
 
75
79
  end
76
- end
80
+
77
81
 
78
82
  Liquid::Template.register_filter(Jekyll::EncFilter)
79
83
 
@@ -87,64 +91,6 @@ def hex2bin(str)
87
91
  [str].pack "H*"
88
92
  end
89
93
 
90
- # # modifies the final html page by encrypting its secure-container content
91
- # Jekyll::Hooks.register :posts, :post_render do |post|
92
- # # puts "---------"
93
- # # puts post.site.config['enc_tags']
94
- # # puts post.data["tags"]
95
- # # puts post.data["key"]
96
- # # puts "<<<<<<<"
97
-
98
- # key = post.data["key"]
99
- # if key
100
- # key = '' + key
101
- # end
102
- # if !key || key.length == 0
103
- # # find key for tag
104
- # posttags = post.data["tags"]
105
- # enctags = post.site.config['enc_tags']
106
- # if posttags && posttags
107
- # for tag in posttags
108
- # if key && key.length > 0
109
- # break;
110
- # end
111
- # for enctag in enctags
112
- # if enctag['tag'] == tag
113
- # key = enctag['password']
114
- # break
115
- # end
116
- # end
117
- # end
118
- # end
119
- # end
120
-
121
-
122
-
123
-
124
- # if key && key.length
125
- # # prepare
126
- # key = post.data['key']
127
- # out = post.output
128
-
129
- # next
130
- # page = Nokogiri::HTML(out)
131
- # content = page.css('div#secure-container')[0].inner_html
132
-
133
- # # encrypt
134
- # aes = OpenSSL::Cipher.new('AES-256-CBC')
135
- # aes.encrypt
136
- # salt = OpenSSL::Random.random_bytes(8)
137
- # iv = aes.random_iv
138
- # aes.key = Digest::SHA256.digest(key + bin2hex(salt))
139
- # aes.iv = iv
140
- # encrypted = bin2hex(aes.update(content) + aes.final).strip
141
-
142
- # # save
143
- # page.css('div#secure-container')[0].inner_html = encrypted
144
- # post.output = page
145
-
146
- # # put iv and salt on page for decryption
147
- # page.css('div#crypt_params')[0].inner_html = "<script>var _gj = {salt: '"+bin2hex(salt)+"', iv: '"+bin2hex(iv)+"' } </script>"
148
-
149
- # end
150
- # end
94
+
95
+
96
+ end
data/lib/ext.rb CHANGED
@@ -66,7 +66,7 @@ module Jekyll
66
66
  url = $g_title_link[@linkTitle]
67
67
  if url == nil || url == LOADINGFLG
68
68
  $g_title_link[@linkTitle] = LOADINGFLG
69
- return "#{@linkTitle} is loading"
69
+ return "`#{@linkTitle} Not Found`"
70
70
  else
71
71
 
72
72
  if $g_config["baseurl"] && $g_config["baseurl"].length > 0
@@ -80,7 +80,7 @@ module Jekyll
80
80
  end
81
81
 
82
82
 
83
- $g_config = Jekyll::sites[0].config
83
+
84
84
  class IncludeCode < Liquid::Tag
85
85
  @filecontent = ""
86
86
  def initialize(tag_name, text, tokens)
@@ -112,21 +112,18 @@ EOF
112
112
 
113
113
 
114
114
 
115
- end
115
+
116
116
 
117
117
  Liquid::Template.register_tag('asset_img', Jekyll::AssetImg)
118
118
  Liquid::Template.register_tag('include_code', Jekyll::IncludeCode)
119
119
  Liquid::Template.register_tag('post_link', Jekyll::PostLink)
120
- Liquid::Template.register_tag('cq', Jekyll::EmptyTag)
121
- Liquid::Template.register_tag('endcq', Jekyll::EmptyTag)
122
- Liquid::Template.register_tag('katexmm', Jekyll::EmptyTag)
123
- Liquid::Template.register_tag('endkatexmm', Jekyll::EmptyTag)
124
120
 
125
121
 
126
122
 
127
123
  module Reading
128
124
  class Generator < Jekyll::Generator
129
125
  def generate(site)
126
+ $g_config = Jekyll::sites[0].config
130
127
  if !File.directory?("tags")
131
128
  Dir.mkdir "tags"
132
129
  end
@@ -178,7 +175,6 @@ end
178
175
  # puts "...."
179
176
  # end
180
177
 
181
- LOADINGFLG = :LOADINGFLG
182
178
  Jekyll::Hooks.register :site, :post_render do |st|
183
179
  # code to call after Jekyll renders a page
184
180
  rebuild = 0
@@ -201,4 +197,4 @@ end
201
197
 
202
198
  end
203
199
 
204
-
200
+ end
@@ -0,0 +1,5 @@
1
+ require "jekyll"
2
+ require "enc"
3
+ require "ext"
4
+ module Jekyll
5
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NoStylePlease2
4
- VERSION = "0.1.3"
4
+ VERSION = "0.3.0"
5
5
  end
File without changes
data/test.rb ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ require "ltec"
3
+ require "nostyleplease2plugins"
4
+
5
+ Jekyll::test
6
+
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.1.3
4
+ version: 0.3.0
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-16 00:00:00.000000000 Z
11
+ date: 2022-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -81,8 +81,10 @@ files:
81
81
  - gem.gemspec
82
82
  - lib/enc.rb
83
83
  - lib/ext.rb
84
+ - lib/no-style-please2-plugins.rb
84
85
  - lib/version/version.rb
85
- - sig/no/style/please2/plugins.rbs
86
+ - sig/no-style-please2-plugins.rbs
87
+ - test.rb
86
88
  homepage: https://github.com/vitock/no-style-please2-plugins
87
89
  licenses: []
88
90
  metadata:
@@ -1,10 +0,0 @@
1
- module No
2
- module Style
3
- module Please2
4
- module Plugins
5
- VERSION: String
6
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
7
- end
8
- end
9
- end
10
- end