no-style-please2-plugins 0.1.3 → 0.2.0.1

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: 8f697e578e78801a1d3f0e5013a647c7586abf3cdd1b6f3370c14da5caae17ab
4
- data.tar.gz: f1fa9322abc159f691a192d7771b1d85ebd253baa549851f56cac89cc7f3f562
3
+ metadata.gz: 2f0a1fe1e54eab7298a9e4030aa641ed131535a550ae51b50399ddd616158b46
4
+ data.tar.gz: 8c40e2dba8c1a045eb1c4fe50f823b7338fdd127b83b6379c487e1fe0356eacc
5
5
  SHA512:
6
- metadata.gz: f82df9bd1d9e8a9e970985b82b3aebee697cb55a92edd2cc7bce892020893260e0176f57abd7a0595bd67ebdc1157d4cf74bfaf88d7b114b48fddce6da48c536
7
- data.tar.gz: b03bc3362a52b6b956635450081a78ae7e19e904f28c8b6d770ceb8522685f9f0d1fcab7112b48cf262bf70a1f5cd504abad52bc4660d0f59fb5081fb819f755
6
+ metadata.gz: 4b190b0ec6165ea08df714727c8aef65a0a779b9724b782021620947e37d1735a09d753da11294431c29422207938b5573106675703957c970d56d79de73a686
7
+ data.tar.gz: 5f690e8d2e8c9fe6a55a1848351c243cb8e6bbd64b0a4222974ed2c0baf2c1b2b2537bb5a92240f665f34b679a79af7f60c88300f2dfed2cf1cb6dc863501e22
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]
@@ -73,7 +76,7 @@ module Jekyll
73
76
 
74
77
 
75
78
  end
76
- end
79
+
77
80
 
78
81
  Liquid::Template.register_filter(Jekyll::EncFilter)
79
82
 
@@ -87,64 +90,6 @@ def hex2bin(str)
87
90
  [str].pack "H*"
88
91
  end
89
92
 
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
93
+
94
+
95
+ end
data/lib/ext.rb CHANGED
@@ -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.2.0.1"
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.2.0.1
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-17 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