jekyll-zeta 0.6.0 → 0.7.1

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: 5fde83c61d8550570f325e6837e4e2c9d7dbcc46b86ae4759d45f0f0db98625c
4
- data.tar.gz: 074165065c305b44267c8d4d9cf81e3de190a9a3e1292b1b2a169f8eecfb07b6
3
+ metadata.gz: 919077f0e2679d399ca69e89c32b77b4564f1b2f8e81b20b31eb681f5f59d5b0
4
+ data.tar.gz: 32ccee6ae73513ba00f818f1b3d47b5eb7eec2060eff0ab53e0fc0730075a4ad
5
5
  SHA512:
6
- metadata.gz: ce34530fa0e16f37593fefed701c3ee56b9694028d078b012f953a9ac408533895932947948058f0e164b4f2de6319af7008d2658e007e4cec42dd905d331dc1
7
- data.tar.gz: bd5ab3a4e6be686f366201a1c55cfbc1623fe9ba331eb688f712a195d63e39c8e6290c328d28a1a3a8fa19f10096d81d437c09d40661f1cbb240a3f3e21313e9
6
+ metadata.gz: 9b22c45cd8bb3e0611f4db3faab73b7297379bdc575c48838e51a0a587d25bb758c06b42b27b84fbeadd328d0033c2094e9cefacb765b68037c97b2c4997d22a
7
+ data.tar.gz: f8a182e18e976e2f9b08d00cf954cf8e5fa0a3451f92b876d595911e46fdfab37f562266764f0a6857d359fe18d67a99d3dc25eda4b472204429a3d159510227
@@ -0,0 +1,51 @@
1
+ {%- if include.collection -%}
2
+ {%- assign posts = include.collection -%}
3
+ {%- else -%}
4
+ {%- assign posts = site.posts -%}
5
+ {%- endif -%}
6
+
7
+ {%- assign jsstr='' -%}
8
+ {%- for post in posts limit: include.limit -%}
9
+
10
+
11
+
12
+ {%- capture url -%}
13
+ {{ post.url | relative_url }}
14
+ {%- endcapture -%}
15
+
16
+ {%- capture postdate -%}
17
+ {{ post.date | date: '%Y-%m-%d' }}
18
+ {%- endcapture -%}
19
+
20
+
21
+ {%- capture posttitlex -%}
22
+ {{ post.title | replace: '"'," "}}
23
+ {%- endcapture -%}
24
+
25
+
26
+ {%- capture jsstr -%}
27
+ {{ jsstr | append: url | append:"\x01" | append: posttitlex | append:"\x01" | append: postdate | append:"\n" }}
28
+ {%- endcapture -%}
29
+ {%- endfor -%}
30
+ <div>
31
+ <span class="heatmap-title">{{ heatMapTitle | site.theme_config.heatMapTitle }}</span>
32
+ <div class='heatmap' id="heatmap">
33
+
34
+
35
+ </div>
36
+ </div>
37
+ <script >
38
+ (function(){
39
+ var _GALLPOSTSTR = "{{jsstr}}";
40
+ {%- assign MothStr = site.theme_config.heatMapMonth -%}
41
+ {%- assign HeatMapShowWeek = site.theme_config.heatMapShowWeek -%}
42
+
43
+ {%- assign HeatMapType = site.theme_config.heatMapType -%}
44
+
45
+
46
+ var _HeatMapType = "{{ HeatMapType | default:'1' }}"
47
+ var _MonthStr = '{{ MothnStr | default: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec" }}'
48
+ var _showWeek = '{{ HeatMapShowWeek | default: "Mon Wed Fri" }}';
49
+ {% include heatmap.js %}
50
+ })()
51
+ </script>
@@ -0,0 +1,152 @@
1
+ ;(function(){
2
+
3
+ var Map = {}
4
+ var arr1 = _GALLPOSTSTR.split("\n")
5
+ arr1.forEach(element => {
6
+ var post = element.split('\x01')
7
+
8
+ var url = post[0]
9
+ var title = post[1]
10
+ var date = post[2]
11
+ if (date && title && url) {
12
+ var arrDatePost = Map[date]
13
+ if (!arrDatePost ) {
14
+ arrDatePost = []
15
+ Map[date] = arrDatePost;
16
+ }
17
+ arrDatePost.push({title,url})
18
+ }
19
+
20
+ });
21
+
22
+
23
+ var Father = document.getElementById("heatmap");
24
+
25
+ const Frag = document.createDocumentFragment();
26
+
27
+ const monthEle = document.createElement("div");
28
+ monthEle.className = "heatmap-month";
29
+ Frag.appendChild(monthEle);
30
+ const monthStr = _MonthStr.split(" ");
31
+
32
+ var dateEnd = new Date();
33
+
34
+ {%- comment -%}
35
+ if(_HeatMapType == '1'){
36
+ dateEnd = new Date()
37
+ }else if(_HeatMapType == '2'){
38
+
39
+ let chooseddate = ''
40
+ for (const key in Map) {
41
+ if (Object.prototype.hasOwnProperty.call(Map, key)) {
42
+ const element = Map[key];
43
+ if(element){
44
+ if(key && key > chooseddate){
45
+ chooseddate = key
46
+ }
47
+ }
48
+ }
49
+ }
50
+
51
+ dateEnd = new Date(chooseddate)
52
+ console.log(chooseddate,dateEnd,typeof chooseddate)
53
+
54
+ }else{
55
+ dateEnd = new Date()
56
+ }
57
+
58
+ {% endcomment %}
59
+
60
+ var nowM = dateEnd.getMonth();
61
+ var nowWeek = dateEnd.getDay();
62
+ var endStamp = dateEnd.getTime()
63
+
64
+ for (var i = 0; i < monthStr.length; i++) {
65
+ var m = document.createElement("span");
66
+ m.className = "heatmap-month-cell";
67
+ m.innerHTML = `${monthStr[(i + nowM + 1) % 12]}`;
68
+ monthEle.appendChild(m);
69
+ }
70
+
71
+ const weekEle = document.createElement("div");
72
+ weekEle.className = "heatmap-week";
73
+ const WeekStr = _showWeek.split(" ");
74
+
75
+ for (var i = 0; i < WeekStr.length; i++) {
76
+ var m = document.createElement("div");
77
+ m.className = "heatmap-week-cell";
78
+ m.innerHTML = `<span>${WeekStr[i]}</span>`;
79
+ weekEle.appendChild(m);
80
+ }
81
+
82
+ Frag.appendChild(weekEle);
83
+
84
+ const dayEle = document.createElement("div");
85
+
86
+ dayEle.className = "heatmap-day";
87
+
88
+ const ColumnsCount = 53;
89
+ const RowCount = 7;
90
+
91
+ var firstDateDayDiff = (ColumnsCount - 1) * RowCount + nowWeek;
92
+
93
+
94
+ console.log(nowWeek, firstDateDayDiff);
95
+
96
+ for (let c = 0; c < ColumnsCount; c++) {
97
+ for (let r = 0; r < RowCount; r++) {
98
+ if (r > nowWeek && c == ColumnsCount - 1) {
99
+ break
100
+ }
101
+ const i = c * RowCount + r ;
102
+ const date = new Date(endStamp - (firstDateDayDiff - i) * 3600000 * 24);
103
+ const month = date.getMonth() + 1
104
+ let dateStr = `${date.getFullYear()}-${month < 10 ? '0' + month : month}-${date.getDate() < 10 ? '0' + date.getDate() : date.getDate() }`
105
+
106
+ var m = document.createElement("span");
107
+ const arrPostInOneDay = Map[dateStr]
108
+ m.classList = `heatmap-day-cell ${!arrPostInOneDay ? 'hm-check-no':arrPostInOneDay.length > 1 ? 'hm-check2' : 'hm-check' }`
109
+
110
+
111
+ if (arrPostInOneDay ) {
112
+ var isDirectly = arrPostInOneDay.length == 1
113
+ var tip = document.createElement("div");
114
+
115
+ if (isDirectly) {
116
+ var lnk = document.createElement('a');
117
+ lnk.href = arrPostInOneDay[0].url
118
+ m.appendChild(lnk)
119
+ }
120
+
121
+ tip.className = "hm-tip";
122
+ var desc = ''
123
+ arrPostInOneDay.forEach(element => {
124
+
125
+ var lnk = document.createElement('a');
126
+ lnk.className = 'hm-tiplink'
127
+ lnk.href = element.url
128
+ tip.appendChild(lnk)
129
+
130
+ var t = document.createElement('span')
131
+ t.className = 'hm-date'
132
+ t.innerText = dateStr.substring(5);
133
+ lnk.appendChild(t);
134
+
135
+
136
+ var t2 = document.createElement('span')
137
+ t2.className = 'hm-title'
138
+ t2.innerText = element.title
139
+ lnk.appendChild(t2);
140
+
141
+ });
142
+ m.appendChild(tip);
143
+
144
+ }
145
+ dayEle.appendChild(m);
146
+ }
147
+ }
148
+
149
+
150
+ Frag.appendChild(dayEle);
151
+ Father.append(Frag);
152
+ })()
data/_includes/home.html CHANGED
@@ -1,9 +1,16 @@
1
+
2
+
3
+
4
+ {%- include heatmap.html -%}
5
+
6
+
1
7
  {%- assign titlelen = page.title.size -%}
2
8
  {%- if titlelen > 0 -%}
3
9
  <h2>{{ page.title }}</h2>
4
10
  {%- endif -%}
5
11
  {%-assign nextPage = site.paginate_path | replace: ':num', '2' -%}
6
12
 
13
+
7
14
  {%
8
15
  include post_list.html
9
16
  limit=site.paginate
@@ -12,4 +19,4 @@
12
19
  show_more_url= nextPage
13
20
  -%}
14
21
 
15
- {{ content }}
22
+ {{ content }}
@@ -0,0 +1,15 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+
6
+ {%- if page.heatmap -%}
7
+ {%- include heatmap.html -%}
8
+ {%- endif -%}
9
+
10
+ {%- assign titlelen = page.title.size -%}
11
+ {%- if titlelen > 0 -%}
12
+ <!-- <h2>{{ page.title }}</h2> -->
13
+ {%- endif -%}
14
+
15
+ {{ content }}
@@ -1,9 +1,14 @@
1
1
  ---
2
2
  layout: default
3
3
  ---
4
+
5
+
6
+ {%- if page.heatmap -%}
7
+ {%- include heatmap.html -%}
8
+ {%- endif -%}
4
9
  {%- assign titlelen = page.title.size -%}
5
10
  {%- if titlelen > 0 -%}
6
- <h2>{{ page.title }}</h2>
11
+ <!-- <h2>{{ page.title }}</h2> -->
7
12
  {%- endif -%}
8
13
 
9
14
  {%-assign posts = site.posts-%}
@@ -0,0 +1,6 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+ <link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
5
+ <br/><br/><br/>
6
+ {%- include heatmap.html -%}
data/_layouts/tags.html CHANGED
@@ -5,7 +5,7 @@ layout: default
5
5
  <div class="post">
6
6
  {%- assign titlelen = page.title.size -%}
7
7
  {%- if titlelen > 0 -%}
8
- <h2>{{ page.title }}</h2>
8
+ <!-- <h2>{{ page.title }}</h2> -->
9
9
  {%- endif -%}
10
10
  <article>
11
11
  {%- comment -%}
@@ -6,6 +6,15 @@ $color-hove: #0064c1;
6
6
  $color-gray: #9ca3af;
7
7
  $color-lightGray: #9ca3af;
8
8
  $color-lightGrayBg: #F0f2f4;
9
+ $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;
10
+
11
+ $dbgBorder:none;//ssolid 1px red;
12
+ $hmbloksizeW:12px;
13
+ $hmbloksizeH:15.2px;
14
+ $dayGap:1px;
15
+ $hmdaywidth: $dayGap * 52 + $hmbloksizeW * 53;
16
+ $hmmonthWidth:40px;
17
+ $hmmwidth: $hmmonthWidth + $hmdaywidth;
9
18
  li {
10
19
  padding: 0.2rem;
11
20
  }
@@ -330,3 +339,167 @@ img{
330
339
  // filter: grayscale(0.1) brightness(0.6);
331
340
  font-size: 0.6em;
332
341
  }
342
+
343
+ .heatmap{
344
+ display: grid;
345
+ grid-template-rows: auto 1fr;
346
+ grid-template-columns: $hmmonthWidth 1fr;
347
+ width: $hmmwidth;
348
+ border: $dbgBorder;
349
+ }
350
+
351
+ .heatmap-title{
352
+ color: $color-black;
353
+ font-size: 1.2rem;
354
+ }
355
+
356
+
357
+ .heatmap-month{
358
+
359
+ grid-column-start: 2;
360
+ grid-column-end: 3;
361
+
362
+ display: grid;
363
+ grid-template-columns:repeat(12,1fr);
364
+
365
+ width: $hmdaywidth;
366
+ border: $dbgBorder;
367
+
368
+ }
369
+
370
+
371
+ .heatmap-month-cell{
372
+ display: flex;
373
+ align-items: center;
374
+ justify-content: center;
375
+
376
+ font-family: $heatFont;
377
+ font-size: 0.8rem;
378
+
379
+ border: $dbgBorder;
380
+ height: 12px;
381
+
382
+ padding: 0.2em 0;
383
+
384
+ }
385
+
386
+
387
+ .heatmap-week{
388
+
389
+ grid-row-start: 2;
390
+ grid-row-end: 3;
391
+ display: grid;
392
+ // grid-template-rows:repeat(4,1fr);
393
+
394
+
395
+ grid-auto-flow: row;
396
+
397
+ height: $hmbloksizeW * 7
398
+ }
399
+
400
+
401
+ .heatmap-week-cell{
402
+ display: flex;
403
+ align-items: center;
404
+ justify-content: center;
405
+ padding-right: 10px;
406
+ font-size: 0.8rem;
407
+ font-family: $heatFont
408
+ }
409
+
410
+ .heatmap-day{
411
+
412
+ display: grid;
413
+ grid-template-columns: repeat(53,1fr);
414
+ grid-template-rows: repeat(7,1fr);
415
+ grid-auto-flow: column;
416
+ gap: $dayGap;
417
+ width: $hmdaywidth;
418
+ }
419
+
420
+ .heatmap-day-cell{
421
+
422
+ border-radius: 2px;
423
+ // height: 20px;
424
+ width: $hmbloksizeW;
425
+ height: $hmbloksizeH;
426
+ }
427
+
428
+ .heatmap-day-cell a{
429
+ height: 100%;
430
+ width: 100%;
431
+ display: block;
432
+ white-space: nowrap;
433
+ overflow:hidden;
434
+ }
435
+
436
+ .hm-check{
437
+ background-color: #40c463bb;
438
+ position: relative;
439
+ cursor: pointer;
440
+ }
441
+
442
+ .hm-check2{
443
+ background-color: #40c463ff;
444
+ position: relative;
445
+ }
446
+
447
+ .hm-check-no{
448
+ background-color: #edebf0;
449
+ }
450
+
451
+ .heatmap-day-cell:hover{
452
+ transform: scale(1.3);
453
+ z-index: 999;
454
+ }
455
+
456
+ .heatmap-day-cell:hover .hm-tip{
457
+ display: block;
458
+ }
459
+
460
+ .hm-tip{
461
+ position: absolute; /* 让子元素浮动 */
462
+ bottom: 100%;
463
+ left: 50%;
464
+ transform: translateX(-50%);
465
+ background-color: rgba(0, 0, 0, 0.8);
466
+ color: white;
467
+ padding: 10px;
468
+ border-radius: 5px;
469
+ z-index: 999;
470
+
471
+ width: auto;
472
+ font-size: 0.8rem;
473
+ display: none;
474
+ }
475
+
476
+ .hm-date{
477
+ color: #fff;
478
+ text-align: center;
479
+
480
+ padding: 0;
481
+ }
482
+
483
+ .hm-title{
484
+ color: #fff;
485
+ white-space: nowrap;
486
+ overflow:hidden;
487
+ text-overflow: ellipsis;
488
+ text-align: left;
489
+ padding-left:0.5rem;
490
+
491
+ max-width: 600px;
492
+
493
+ }
494
+
495
+ .hm-tiplink{
496
+ padding: 0.2rem 0;
497
+ }
498
+
499
+ .red{
500
+ background-color: #ee5500;
501
+ }
502
+
503
+ .border{
504
+ border:solid 1px red;
505
+ }
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.6.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - vitock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-14 00:00:00.000000000 Z
11
+ date: 2024-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -68,14 +68,18 @@ files:
68
68
  - _includes/encrypted.html
69
69
  - _includes/goat_counter.html
70
70
  - _includes/head.html
71
+ - _includes/heatmap.html
72
+ - _includes/heatmap.js
71
73
  - _includes/home.html
72
74
  - _includes/main.css
73
75
  - _includes/menu_item.html
74
76
  - _includes/navbar.html
75
77
  - _includes/paginate.html
76
78
  - _includes/post_list.html
79
+ - _layouts/about.html
77
80
  - _layouts/archive.html
78
81
  - _layouts/default.html
82
+ - _layouts/heatmap.html
79
83
  - _layouts/home.html
80
84
  - _layouts/page.html
81
85
  - _layouts/paginate.html