no-style-please2 0.5.2 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_config.yml +6 -2
- data/_includes/encrypted.html +32 -10
- data/_layouts/archive.html +27 -1
- data/_layouts/tagpage.html +12 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c99df39b0e743327415cec4366cbaf21a7c52a5fc2b67040e443ed92fbe8df
|
4
|
+
data.tar.gz: 9ee3f4e378217b7683fecf0fbe640bdf8353ca409f5868659d697ad3c6b6a018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea652495e5857f22c787f91c2166e16642d9db4831b8251243c618e58193adefa17d91cf8d02067757ad560e667320c136c6c32d81ec6065e04a9b8537f51937
|
7
|
+
data.tar.gz: f3fff925aab0aa75bd082bb6dce24a5ac12f6d65f85080a310a3e8359e89ee702aeee2d21b17db145f44332aac8e2366462d1dde66825ca7d24eac3a1e02a8ce
|
data/_config.yml
CHANGED
@@ -21,7 +21,12 @@ theme_config:
|
|
21
21
|
encrypt_clear_btn: "清空缓存密码"
|
22
22
|
decrypt_btn: 解密
|
23
23
|
encrypt_btn: 重新加密
|
24
|
-
|
24
|
+
tag_showall: true
|
25
|
+
all_tags_path: tags
|
26
|
+
all_tags_title: All Tags
|
27
|
+
archive_date_format: "%Y-%m"
|
28
|
+
archive_title_date_format: "%m-%d"
|
29
|
+
|
25
30
|
#
|
26
31
|
# forbid_cache_password: true
|
27
32
|
|
@@ -48,4 +53,3 @@ enc_tags:
|
|
48
53
|
- tag: encrypt2
|
49
54
|
# 123
|
50
55
|
password: AQAQACAAIQCvWkhJdhn0b21Pz381AdTeMLb5bRO4d2F3usQtpIL0fDD0G8cg4klENXxJNX+rAHwD8VW2iJo4hZKDQrjdOjbJFugo60XnMmbdLEfzXpkqGpjjbe875/owWyNnGGPk3Vf4
|
51
|
-
|
data/_includes/encrypted.html
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
<input style="width:100%; " type="password" id="passwordinput" placeholder="输入密码"></input>
|
6
6
|
<p>
|
7
7
|
<input type="button" value= "{{ site.theme_config.decrypt_btn | default : 'Decrypt' }}" id="DecryptBtn"/>
|
8
|
+
<input type="button" value= "{{ site.theme_config.encrypt_clear_btn | default: 'Clear password cache' }}" id="ClearBtn1"/>
|
8
9
|
|
9
10
|
</div>
|
10
11
|
|
@@ -14,7 +15,7 @@
|
|
14
15
|
|
15
16
|
<input type="button" value= "{{ site.theme_config.encrypt_btn | default: 'Encrypt' }}" id="EncryptBtn"/>
|
16
17
|
|
17
|
-
<input type="button" value= "{{ site.theme_config.encrypt_clear_btn | default: 'Clear password cache' }}" id="
|
18
|
+
<input type="button" value= "{{ site.theme_config.encrypt_clear_btn | default: 'Clear password cache' }}" id="ClearBtn2"/>
|
18
19
|
|
19
20
|
</div>
|
20
21
|
<div id = 'decryptContent'>
|
@@ -25,27 +26,44 @@
|
|
25
26
|
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.1/js/md5.js"></script>
|
26
27
|
<script>
|
27
28
|
!function(){
|
28
|
-
|
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)
|
29
37
|
|
30
38
|
function hexToUint8Arr(hexString){
|
31
39
|
return new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
|
32
40
|
}
|
33
|
-
|
41
|
+
|
42
|
+
|
43
|
+
function decrypt (key0,isCached){
|
34
44
|
// const key = Uint8Array([...]); // 32 bytes key
|
35
|
-
var key = new TextEncoder("utf-8").encode(md5(key0));
|
36
45
|
|
37
|
-
|
38
|
-
var
|
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
|
+
}
|
39
57
|
var nonce = hexToUint8Arr(nonceStr)
|
40
58
|
|
41
|
-
|
59
|
+
|
42
60
|
const message = Base64.toUint8Array(msg)
|
43
61
|
// Encrypt //
|
44
62
|
const decrypt = new JSSalsa20(key, nonce).decrypt(message);
|
45
63
|
var plain = new TextDecoder("utf-8").decode(decrypt)
|
46
64
|
var check = md5(plain)
|
47
65
|
if(check.indexOf(nonceStr) == 0){
|
48
|
-
setKey(
|
66
|
+
setKey(keyDgst)
|
49
67
|
/// hide input
|
50
68
|
document.getElementById("encrypted").style.display = 'none'
|
51
69
|
// / show decrypted
|
@@ -94,7 +112,10 @@
|
|
94
112
|
clearKey()
|
95
113
|
}
|
96
114
|
|
97
|
-
document.getElementById("
|
115
|
+
document.getElementById("ClearBtn1").onclick = function(){
|
116
|
+
localStorage.clear();
|
117
|
+
}
|
118
|
+
document.getElementById("ClearBtn2").onclick = function(){
|
98
119
|
localStorage.clear();
|
99
120
|
}
|
100
121
|
|
@@ -124,8 +145,9 @@
|
|
124
145
|
}
|
125
146
|
var cachekey = readKey()
|
126
147
|
if(cachekey){
|
127
|
-
decrypt(cachekey)
|
148
|
+
decrypt(cachekey,true)
|
128
149
|
}
|
150
|
+
|
129
151
|
{% endif %}
|
130
152
|
|
131
153
|
|
data/_layouts/archive.html
CHANGED
@@ -6,4 +6,30 @@ layout: default
|
|
6
6
|
|
7
7
|
<h1>{{ page.title }}</h1>
|
8
8
|
|
9
|
-
|
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
|
+
{{ymCur}}
|
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 -%}
|
data/_layouts/tagpage.html
CHANGED
@@ -3,13 +3,22 @@ layout: default
|
|
3
3
|
---
|
4
4
|
{%-include back_link.html -%}
|
5
5
|
<div class="post">
|
6
|
-
<h1
|
6
|
+
<h1></h1>
|
7
|
+
<li>Tag: {{ page.tag }}</li>
|
8
|
+
|
7
9
|
<ul>
|
8
|
-
{% for post in site.tags[page.tag] %}
|
10
|
+
{% for post in site.tags[page.tag] %}
|
9
11
|
<li><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a> ({{ post.date | date_to_string }})<br>
|
10
12
|
{{ post.description }}
|
11
13
|
</li>
|
12
14
|
{% endfor %}
|
13
15
|
</ul>
|
14
16
|
</div>
|
15
|
-
|
17
|
+
{% if site.theme_config.tag_showall %}
|
18
|
+
<li><a href="{{ site.baseurl }}/{{site.theme_config.all_tags_path | default:'tags' }}.html"> {{site.theme_config.all_tags_title | default:'All Tags' }}</a>
|
19
|
+
</li>
|
20
|
+
|
21
|
+
{% endif %}
|
22
|
+
|
23
|
+
<hr>
|
24
|
+
|
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.
|
4
|
+
version: 0.6.1
|
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-
|
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.
|
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.
|
40
|
+
version: 0.3.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- r
|