jekyll-zeta 0.9.8.1 → 0.9.10

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: 28c35ed3eaa0a85fb55d982c6b9c6a1457461747d8f65e4472d39daa6ce4de7e
4
- data.tar.gz: dcfb141e16e82c5683ca974a3ae8d78088d2a1223cd68aa0f5aefc5d25efd0fe
3
+ metadata.gz: 6cd84b8ba748c01cfd4776295116a4bf6593ef12bb1662ad56cbb5b1db95a569
4
+ data.tar.gz: d57343875f6aa327652889884babf666f76552ea2cb9eb3063b70486d1d584cd
5
5
  SHA512:
6
- metadata.gz: 86b78e40aaa99a3f51b72ac43af2a6aee789bfe76ab00b7c2899d5f5a4e3bcc4619c05c8f885f5a3d872ea06fc12033bb2c131ed4aa593b57c98c3adbb5d28e5
7
- data.tar.gz: 18ec27221c62e491795de4e7d0f4ee30b3811da7c952b0c9b2cec1636bc3ec2552ead6647035b2c8fbe6c2dca018acdde784ce92d3b73dc474ddfb896138864d
6
+ metadata.gz: 6893d527ca9c609ecc25d55baaccbf7ba58882239328aac78f6f9967b0ebc8819c69956566138a882177af01b9baa9bd395ab1750828a48c30ebbd81ae4db697
7
+ data.tar.gz: 7ea6209372677d4320c4673f5f51a67923b40fae6da0cd59236f285a30be0ad7f603ce78126169d913de97fa10821fabde14fff9a307ccf13b485e5c620ae34e
@@ -0,0 +1,170 @@
1
+
2
+ (function () {
3
+ var g_id = 100;
4
+
5
+
6
+ function getConfigFromStr(str,obj){
7
+ if (str && str.startsWith('#')) {
8
+ // #color #121212
9
+ // #title 123
10
+ let arr = str.split(' ')
11
+ if(arr.length >= 2){
12
+ let key = arr[0].substring(1)
13
+ if(key ){
14
+ obj[key] = str.substring(key.length + 2).trim()
15
+ return 1
16
+ }
17
+ }
18
+ }
19
+ return 0
20
+ }
21
+
22
+ /// 2025-01-01 描述,日期格式yyyy-mm-dd,空格后跟上 描述
23
+ function getDataFromSignleLine(str0,gData) {
24
+ let str = str0.trim()
25
+ if (!str) return null
26
+
27
+ if(getConfigFromStr(str,gData)) return null
28
+
29
+
30
+ var arr = str.split(" ")
31
+ var date0 = arr[0]
32
+ let date = ''
33
+ if (date0) {
34
+ let ymd = date0.split("-")
35
+ if (ymd.length == 3) {
36
+ let year = ymd[0]
37
+ let month = ymd[1]
38
+ let day = ymd[2]
39
+
40
+ let nY = Number(year)
41
+ let nM = Number(month)
42
+ let nD = Number(month)
43
+ if (isNaN(nY) || isNaN(nD) || isNaN(nM) || nY < 1900 || nY > 2100 || nM < 1 || nM > 12 || nD < 1 || nD > 31) {
44
+ return null
45
+ }
46
+ date = year + "-" + month.padStart(2, '0') + "-" + day.padStart(2, '0')
47
+ }
48
+ }
49
+ else {
50
+ return null
51
+ }
52
+
53
+ if (!date) {
54
+ return null
55
+ }
56
+ var title = ""
57
+ if (arr.length > 1) {
58
+ title = arr.slice(1).join(" ")
59
+ }
60
+ return { date: date, title: title }
61
+ }
62
+
63
+ function fillDataObj(data, item) {
64
+ if (!item) return
65
+ let y = item.date.substring(0, 4);
66
+ let m = item.date.substring(5, 7);
67
+ let c = data.allYear[y];
68
+ data.allYear[y] = c ? c + 1 : 1;
69
+
70
+ let yObj = data[y]
71
+ if (!yObj) {
72
+ yObj = {}
73
+ data[y] = yObj;
74
+ }
75
+
76
+ let arr = yObj[m]
77
+ if (!arr) {
78
+ arr = []
79
+ yObj[m] = arr
80
+ }
81
+ arr.push(item)
82
+
83
+ }
84
+
85
+
86
+ async function wait (t ) {
87
+ return new Promise(function(r){
88
+ setTimeout(() => {
89
+ r()
90
+ }, t );
91
+ })
92
+ }
93
+
94
+ function parseDataAndCeateMap(strData,node) {
95
+
96
+
97
+ let allYear = {}
98
+ let dataObj = { allYear: allYear };
99
+
100
+ let Recent365Count = 0;
101
+ let nowDate = new Date
102
+ let Recent365YMD = `${nowDate.getFullYear() - 1}-${(nowDate.getMonth() + 1).toString().padStart(2, '0')}-${nowDate.getDate().toString().padStart(2, '0')}`
103
+
104
+
105
+ strData.split("\n").forEach(function (str,idx) {
106
+ if(idx == 0) return
107
+ let item = getDataFromSignleLine(str,dataObj)
108
+ fillDataObj(dataObj, item)
109
+ if (item) {
110
+ if (item.date >= Recent365YMD) {
111
+ Recent365Count++
112
+ }
113
+ }
114
+ })
115
+
116
+ let allYearArr = Object.keys(allYear).sort().reverse()
117
+ console.log(dataObj)
118
+
119
+ if(Recent365Count){
120
+ create_heatmap('lmpRecent365' + g_id ++, '', dataObj, "Last 1Y", Recent365Count,node)
121
+ }
122
+
123
+ for (let i = 0; i < allYearArr.length; i++) {
124
+ let y = allYearArr[i]
125
+ create_heatmap('lmp' + y + g_id ++ , y, dataObj,undefined,undefined,node)
126
+ }
127
+
128
+
129
+
130
+ };
131
+
132
+ async function initData(){
133
+ let arrCodes = document.querySelectorAll('pre > code')
134
+ if (!arrCodes || arrCodes.length == 0) return
135
+
136
+ if (arrCodes.length > 0) {
137
+ for (let i = 0; i < arrCodes.length; i ++) {
138
+ const code = arrCodes[i ];
139
+ var strAll = code.textContent
140
+ if (!strAll.startsWith("#mapdata")) {
141
+ return
142
+ }
143
+
144
+ parseDataAndCeateMap(strAll,code.parentNode.parentNode.parentNode)
145
+
146
+
147
+ }
148
+
149
+ }
150
+ }
151
+
152
+ initData()
153
+
154
+ window['_after_dec_fun'] = function () {
155
+ let con = document.getElementById('loveiContainer')
156
+ if (!con) {
157
+ let decryptContent = document.getElementById('decryptContent')
158
+ if (!decryptContent) return
159
+ con = document.createElement('div')
160
+ con.id = 'loveiContainer'
161
+ decryptContent.insertBefore(con, decryptContent.firstChild)
162
+
163
+ }
164
+
165
+ initData()
166
+ }
167
+ window['_after_enc_fun'] = function () {
168
+ document.getElementById('loveiContainer').innerHTML = ''
169
+ }
170
+ })();
data/_includes/heatmap.js CHANGED
@@ -1,7 +1,9 @@
1
1
  function __filldata(heatmapid,endYear,WeeKStartStr,heatMapLoadCount,_MonthStr,_showWeek,_allyearurl,dataSourceObj,checkPrefix) {
2
+ checkPrefix = null
2
3
 
3
4
  const WeeKStart = parseInt(WeeKStartStr)
4
5
 
6
+ const color = dataSourceObj && dataSourceObj.color;
5
7
 
6
8
  var GDATA = window._G_DATA;
7
9
  if (!GDATA) {
@@ -33,7 +35,7 @@ function __filldata(heatmapid,endYear,WeeKStartStr,heatMapLoadCount,_MonthStr,_s
33
35
  const minYmd = `${Number(endYear) - 1}${maxDateYmd.substring(4)}`
34
36
 
35
37
 
36
- console.log('maxDateYmd',maxDateYmd)
38
+
37
39
 
38
40
  const dateEnd =
39
41
  endYear && endYear.length == 4 ? new Date(maxDateYmd) : new Date();
@@ -240,6 +242,12 @@ function __filldata(heatmapid,endYear,WeeKStartStr,heatMapLoadCount,_MonthStr,_s
240
242
  : checkClassPrefix + "-check"
241
243
  }`;
242
244
 
245
+ if (color && arrPostInOneDay && arrPostInOneDay.length) {
246
+ dayCell.style.backgroundColor = color + (arrPostInOneDay.length > 2 ? "ff" : arrPostInOneDay.length > 1 ? 'cc' : '99')
247
+ }
248
+
249
+
250
+
243
251
  if (arrPostInOneDay && arrPostInOneDay.length > 0) {
244
252
  let isDirectly = arrPostInOneDay.length == 1;
245
253
  let tip = document.createElement("div");
@@ -54,8 +54,8 @@ layout: default
54
54
 
55
55
 
56
56
  <script >
57
- function create_heatmap(heatmapid,endYear,dataObj,title,count){
58
- let container = document.getElementById('loveiContainer')
57
+ function create_heatmap(heatmapid,endYear,dataObj,title,count,node){
58
+ let container = document.createElement('div')
59
59
  let divtitle = document.createElement('div')
60
60
  divtitle.className = 'lv-year'
61
61
 
@@ -66,7 +66,7 @@ layout: default
66
66
 
67
67
  let divYearC = document.createElement('div')
68
68
  divYearC.className = 'lv-year-count'
69
- divYearC.innerText = count || ('' + dataObj.allYear[endYear])
69
+ divYearC.innerText = '' + (count || (dataObj.allYear[endYear] ||''))
70
70
  divtitle.appendChild(divYearC)
71
71
 
72
72
 
@@ -77,6 +77,7 @@ layout: default
77
77
  div.id = heatmapid
78
78
 
79
79
  container.appendChild(div)
80
+ node.parentNode.insertBefore(container,node)
80
81
 
81
82
  setTimeout(() => {
82
83
  create_heatmap0( heatmapid,endYear,dataObj)
@@ -129,134 +130,6 @@ layout: default
129
130
 
130
131
 
131
132
  <script>
132
- (function(){
133
-
134
- /// 2025-01-01 描述,日期格式yyyy-mm-dd,空格后跟上 描述
135
- function getDataFromSignleLine(str0){
136
- let str = str0.trim()
137
- if(!str) return null
138
- var arr = str.split(" ")
139
- var date0 = arr[0]
140
- let date = ''
141
- if(date0 ){
142
- let ymd = date0.split("-")
143
- if(ymd.length == 3){
144
- let year = ymd[0]
145
- let month = ymd[1]
146
- let day = ymd[2]
147
-
148
- let nY = Number(year)
149
- let nM = Number(month)
150
- let nD = Number(month)
151
- if (isNaN(nY) || isNaN(nD) || isNaN(nM) || nY < 1900 || nY > 2100 || nM < 1 || nM > 12 || nD < 1 || nD > 31) {
152
- return null
153
- }
154
- date = year + "-" + month.padStart(2, '0') + "-" + day.padStart(2, '0')
155
- }
156
- }
157
- else{
158
- return null
159
- }
160
-
161
- if (!date) {
162
- console.error("Invalid date format: " + str0)
163
- return null
164
- }
165
- var title = ""
166
- if(arr.length > 1){
167
- title = arr.slice(1).join(" ")
168
- }
169
- return {date:date,title:title}
170
- }
171
-
172
- function fillDataObj(data,item){
173
- if(!item) return
174
- let y = item.date.substring(0,4);
175
- let m = item.date.substring(5,7);
176
- let c = data.allYear[y];
177
- data.allYear[y] = c ? c + 1 : 1;
178
-
179
- let yObj = data[y]
180
- if(!yObj){
181
- yObj = {}
182
- data[y] = yObj;
183
- }
184
-
185
- let arr = yObj[m]
186
- if(!arr){
187
- arr = []
188
- yObj[m] = arr
189
- }
190
- arr.push(item)
191
-
192
- }
193
- function initData(){
194
- var endYear = "{{ include.endYear }}"
195
-
196
- let allYear = {}
197
- let data = {allYear:allYear};
198
-
199
-
200
-
201
-
202
- let Recent365Count = 0;
203
- let nowDate = new Date
204
- let Recent365YMD = `${nowDate.getFullYear()-1}-${(nowDate.getMonth() + 1).toString().padStart(2, '0')}-${nowDate.getDate().toString().padStart(2, '0')}`
205
-
206
- console.log(Recent365YMD)
207
-
208
-
209
- let arrCodes = document.querySelectorAll('pre > code')
210
- if(!arrCodes || arrCodes.length == 0) return
211
- if(arrCodes.length > 0){
212
- arrCodes.forEach(function(code){
213
- var strAll = code.textContent
214
- strAll.split("\n").forEach(function(str){
215
- let item = getDataFromSignleLine(str)
216
- fillDataObj(data,item)
217
- if(item ){
218
- if(item.date >= Recent365YMD){
219
-
220
- Recent365Count ++
221
- }
222
-
223
- }
224
- })
225
-
226
- })
227
- }
228
-
229
- let allYearArr = Object.keys(allYear).sort().reverse()
230
-
231
- create_heatmap('lmpRecent365' ,'',data ,"Last 1Y",Recent365Count)
232
- for(let i = 0; i < allYearArr.length; i++){
233
- let y = allYearArr[i]
234
- create_heatmap('lmp' + y ,y,data )
235
-
236
-
237
- }
238
-
239
-
240
- };
241
-
242
- initData()
243
-
244
- window['_after_dec_fun'] = function(){
245
- let con = document.getElementById('loveiContainer')
246
- if(!con){
247
- let decryptContent = document.getElementById('decryptContent')
248
- if(!decryptContent) return
249
- con = document.createElement('div')
250
- con.id = 'loveiContainer'
251
- decryptContent.insertBefore(con,decryptContent.firstChild)
252
-
253
- }
254
-
255
- initData()
256
- }
257
- window['_after_enc_fun'] = function (){
258
- document.getElementById('loveiContainer').innerHTML = ''
259
- }
260
- })();
261
133
 
134
+ {%- include getmapdata.js %}
262
135
  </script>
data/_sass/heatmap.scss CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  $hmbloksizeH:13px;
3
3
  $dayGap:1px;
4
- $heatFont:Georgia,"Nimbus Roman No9 L","Songti SC",STSong,"AR PL New Sung","AR PL SungtiL GB",NSimSun,SimSun,"TW\-Sung","WenQuanYi Bitmap Song","AR PL UMing CN","AR PL UMing HK","AR PL UMing TW","AR PL UMing TW MBE",sans-serif;
4
+ // $heatFont: 'Courier New', Courier, monospace;; //Georgia,"Nimbus Roman No9 L","Songti SC",STSong,"AR PL New Sung","AR PL SungtiL GB",NSimSun,SimSun,"TW\-Sung","WenQuanYi Bitmap Song","AR PL UMing CN","AR PL UMing HK","AR PL UMing TW","AR PL UMing TW MBE",sans-serif;
5
5
 
6
6
  .heatmap{
7
7
  display: grid;
@@ -36,7 +36,7 @@ $heatFont:Georgia,"Nimbus Roman No9 L","Songti SC",STSong,"AR PL New Sung","AR P
36
36
  align-items: center;
37
37
  justify-content: center;
38
38
 
39
- font-family: $heatFont;
39
+ // font-family: $heatFont;
40
40
  font-size: 0.8rem;
41
41
 
42
42
  height: 12px;
@@ -65,7 +65,7 @@ $heatFont:Georgia,"Nimbus Roman No9 L","Songti SC",STSong,"AR PL New Sung","AR P
65
65
  justify-content: center;
66
66
  padding-right: 0.2em;
67
67
  font-size: 0.8rem;
68
- font-family: $heatFont;
68
+ // font-family: $heatFont;
69
69
  line-height: $hmbloksizeH;
70
70
  height: $hmbloksizeH;
71
71
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-zeta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8.1
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - vitock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-11 00:00:00.000000000 Z
11
+ date: 2025-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -66,6 +66,7 @@ files:
66
66
  - _includes/back_link.html
67
67
  - _includes/collecttags.html
68
68
  - _includes/encrypted.html
69
+ - _includes/getmapdata.js
69
70
  - _includes/goat_counter.html
70
71
  - _includes/head.html
71
72
  - _includes/heatmap.html