no-style-please2 0.5.3 → 0.6.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: 2461eca97e61c3f33512d5dac781ee5136f3d56fec9a7a6dd6231de205a5f6c3
4
- data.tar.gz: 64cca40402fa13421ad158a8db0d1fe3025096e7afe6e2e7c890ff735d6c31eb
3
+ metadata.gz: d16d4e728f69786035d7d7664f50e0979aefdd6b1e592df575e374eb49ed2ddf
4
+ data.tar.gz: 9f7981684ca86279f80e8adad874ab81c897ffd57c4fb8d5db7b360e1fb54543
5
5
  SHA512:
6
- metadata.gz: 5a03bf0b15b4c0ea7df4f3e8873d7761efd6060978114ba865afe57af65ed6bdb2c279148c35d1b8e7ecf1f0e221ecdf279dee3e7772a205ab4952a728b9b27a
7
- data.tar.gz: 4afe8a137187b62c5cc3d4bd47b3d147169c3d51a32b4227d268ca1f126ddb1b8dfd5b5e756915a3128cb8798360a0e62c779c7ae423deba80ab7d7435819878
6
+ metadata.gz: 653cf27985619ec6cd0193f414a93469c9743e07e5bb6f0399fb6ceb27d2581a725ace98870547603a823fd88427a98c68d49c563cf23d6ec0f54770521bdf40
7
+ data.tar.gz: ebe39749778b2d148ded775e7ba3f0d48ac18dcc6fcbf8f01728b2839a82bd55abd2805d39d38f6bcde4b7ebee6dfff8d1019b667796f5bd424c310e7721834a
data/_config.yml CHANGED
@@ -24,6 +24,8 @@ theme_config:
24
24
  tag_showall: true
25
25
  all_tags_path: tags
26
26
  all_tags_title: All Tags
27
+ archive_date_format: "%Y-%m"
28
+ archive_title_date_format: "%m-%d"
27
29
 
28
30
  #
29
31
  # forbid_cache_password: true
@@ -51,4 +53,3 @@ enc_tags:
51
53
  - tag: encrypt2
52
54
  # 123
53
55
  password: AQAQACAAIQCvWkhJdhn0b21Pz381AdTeMLb5bRO4d2F3usQtpIL0fDD0G8cg4klENXxJNX+rAHwD8VW2iJo4hZKDQrjdOjbJFugo60XnMmbdLEfzXpkqGpjjbe875/owWyNnGGPk3Vf4
54
-
@@ -26,27 +26,44 @@
26
26
  <script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.1/js/md5.js"></script>
27
27
  <script>
28
28
  !function(){
29
- var encryptedContent = '{{ content | contentEncrypt:page}}'
29
+
30
+ {%- capture prefix0 %} {{page.url |default: "no-style-please2" }} {% endcapture -%}
31
+ {%- capture prefix %} {{prefix0 | strip }} {% endcapture -%}
32
+
33
+ const preFix = "{{prefix}}"
34
+ var encryptedContent = '{{ content | contentEncrypt:page, prefix}}'
35
+ const nonceStr = encryptedContent.substring(0,16);
36
+ const msg = encryptedContent.substring(17)
30
37
 
31
38
  function hexToUint8Arr(hexString){
32
39
  return new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
33
40
  }
34
- function decrypt (key0){
41
+
42
+
43
+ function decrypt (key0,isCached){
35
44
  // const key = Uint8Array([...]); // 32 bytes key
36
- var key = new TextEncoder("utf-8").encode(md5(key0));
37
45
 
38
- /// hex
39
- var nonceStr = encryptedContent.substring(0,16)
46
+ var key = ''
47
+ var keyDgst = ""
48
+ if(isCached){
49
+ keyDgst= key0
50
+ key = new TextEncoder("utf-8").encode(keyDgst);
51
+ }
52
+ else{
53
+ var keyS = preFix + key0 + preFix
54
+ keyDgst = md5(keyS)
55
+ key = new TextEncoder("utf-8").encode(keyDgst);
56
+ }
40
57
  var nonce = hexToUint8Arr(nonceStr)
41
58
 
42
- const msg = encryptedContent.substring(17)
59
+
43
60
  const message = Base64.toUint8Array(msg)
44
61
  // Encrypt //
45
62
  const decrypt = new JSSalsa20(key, nonce).decrypt(message);
46
63
  var plain = new TextDecoder("utf-8").decode(decrypt)
47
64
  var check = md5(plain)
48
65
  if(check.indexOf(nonceStr) == 0){
49
- setKey(key0)
66
+ setKey(keyDgst)
50
67
  /// hide input
51
68
  document.getElementById("encrypted").style.display = 'none'
52
69
  // / show decrypted
@@ -128,8 +145,9 @@
128
145
  }
129
146
  var cachekey = readKey()
130
147
  if(cachekey){
131
- decrypt(cachekey)
148
+ decrypt(cachekey,true)
132
149
  }
150
+
133
151
  {% endif %}
134
152
 
135
153
 
@@ -6,4 +6,30 @@ layout: default
6
6
 
7
7
  <h1>{{ page.title }}</h1>
8
8
 
9
- {%-include post_list.html category=page.which_category-%}
9
+
10
+ {%-assign posts = site.posts-%}
11
+ {%- if posts.size > 0 -%}
12
+
13
+ {% assign ymPre = "" %}
14
+ {% capture archive_date_format %} {{ site.theme_config.archive_date_format | default: "%Y"}}{% endcapture %}
15
+
16
+ {% capture archive_date_titleformat %} {{ site.theme_config.archive_title_date_format | default: "%m-%d"}}{% endcapture %}
17
+ {%- for post in posts limit: include.limit -%}
18
+ {% capture ymCur %} {{post.date | date: archive_date_format}} {% endcapture %}
19
+ {% if ymCur != ymPre %}
20
+ <h2>{{ymCur}}</h2>
21
+ {% endif %}
22
+ {% assign ymPre = ymCur %}
23
+
24
+
25
+ <ul>
26
+
27
+
28
+ <li>
29
+ <span>{{- post.date | date: archive_date_titleformat }}</span>
30
+ <a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
31
+ </li>
32
+
33
+ </ul>
34
+ {%- endfor -%}
35
+ {%- endif -%}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: no-style-please2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vitock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-17 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
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.0
33
+ version: 0.3.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.0
40
+ version: 0.3.0
41
41
  description:
42
42
  email:
43
43
  - r