type-on-strap 2.4.13 → 2.5.0
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 +4 -4
- data/README.md +0 -2
- data/_includes/blog/blog.liquid +3 -3
- data/_includes/blog/blog_nav.liquid +1 -1
- data/_includes/blog/post_footer.liquid +1 -0
- data/_includes/default/category_list.liquid +22 -0
- data/_includes/default/head.liquid +8 -3
- data/_includes/default/tags_list.liquid +2 -2
- data/_includes/portfolio.html +5 -5
- data/_includes/social/cusdis.liquid +5 -5
- data/_includes/social/disqus.liquid +6 -11
- data/_includes/social/giscus.liquid +17 -17
- data/_includes/social/utterances.liquid +8 -8
- data/_layouts/categories.liquid +79 -17
- data/_layouts/default.html +3 -3
- data/_layouts/page.liquid +10 -4
- data/_layouts/post.liquid +10 -3
- data/_layouts/search.liquid +10 -3
- data/_sass/external/_katex.scss +1 -1
- data/_sass/external/katex/katex.scss +1 -1
- data/_sass/layouts/_categories.scss +79 -38
- data/_sass/layouts/_posts.scss +6 -0
- data/_sass/layouts/_search.scss +10 -0
- data/_sass/layouts/_tags.scss +12 -1
- data/assets/js/comments-lazy-load.js +123 -0
- data/assets/js/comments-lazy-load.min.js +1 -0
- data/assets/js/vendor/katex.min.js +1 -1
- data/assets/js/vendor/mermaid.min.js +248 -248
- data/assets/js/vendor/simple-jekyll-search.min.js +3 -3
- metadata +5 -5
data/_sass/layouts/_posts.scss
CHANGED
data/_sass/layouts/_search.scss
CHANGED
|
@@ -56,3 +56,13 @@
|
|
|
56
56
|
text-decoration: none;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
.search-highlight {
|
|
61
|
+
background-color: rgba(255, 221, 76, 0.5);
|
|
62
|
+
padding: 2px 4px;
|
|
63
|
+
border-radius: 3px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-theme="dark"] .search-highlight {
|
|
67
|
+
background-color: rgba(167, 139, 250, 0.5); /* #a78bfa - violet with blue undertones */
|
|
68
|
+
}
|
data/_sass/layouts/_tags.scss
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
.tag-
|
|
1
|
+
.tag-category-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
gap: 1em;
|
|
2
7
|
width: 100%;
|
|
3
8
|
padding-bottom: $padding-x-small;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.tag-list,
|
|
12
|
+
.category-list {
|
|
13
|
+
flex: 0 1 auto;
|
|
14
|
+
padding-bottom: 0;
|
|
4
15
|
|
|
5
16
|
a.button {
|
|
6
17
|
margin: 0.1em;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Comments Lazy Loader
|
|
3
|
+
* Loads comment widgets (Cusdis, Disqus, Giscus, Utterances) only when they're about to become visible
|
|
4
|
+
* This prevents blocking Mermaid and other critical scripts
|
|
5
|
+
*/
|
|
6
|
+
(function() {
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Generic lazy loader for any comment system
|
|
11
|
+
* @param {string} containerId - The ID of the container element
|
|
12
|
+
* @param {function} loadCallback - Function to call when loading should happen
|
|
13
|
+
*/
|
|
14
|
+
function createLazyLoader(containerId, loadCallback) {
|
|
15
|
+
const container = document.getElementById(containerId);
|
|
16
|
+
if (!container || container.getAttribute('data-lazy-load') !== 'true') return;
|
|
17
|
+
|
|
18
|
+
let loaded = false;
|
|
19
|
+
|
|
20
|
+
function load() {
|
|
21
|
+
if (loaded) return;
|
|
22
|
+
loaded = true;
|
|
23
|
+
loadCallback(container);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if ('IntersectionObserver' in window) {
|
|
27
|
+
const observer = new IntersectionObserver(function(entries) {
|
|
28
|
+
entries.forEach(function(entry) {
|
|
29
|
+
if (entry.isIntersecting) {
|
|
30
|
+
load();
|
|
31
|
+
observer.unobserve(container);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}, {
|
|
35
|
+
rootMargin: '400px' // Load 400px before it comes into view
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
observer.observe(container);
|
|
39
|
+
} else {
|
|
40
|
+
// Fallback for browsers without IntersectionObserver
|
|
41
|
+
if (document.readyState === 'complete') {
|
|
42
|
+
load();
|
|
43
|
+
} else {
|
|
44
|
+
window.addEventListener('load', load);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Cusdis loader
|
|
50
|
+
createLazyLoader('cusdis_thread', function(container) {
|
|
51
|
+
const lang = container.getAttribute('data-lang');
|
|
52
|
+
|
|
53
|
+
if (lang) {
|
|
54
|
+
const langScript = document.createElement('script');
|
|
55
|
+
langScript.src = 'https://cusdis.com/js/widget/lang/' + lang + '.js';
|
|
56
|
+
langScript.async = true;
|
|
57
|
+
document.body.appendChild(langScript);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const mainScript = document.createElement('script');
|
|
61
|
+
mainScript.src = 'https://cusdis.com/js/cusdis.es.js';
|
|
62
|
+
mainScript.async = true;
|
|
63
|
+
document.body.appendChild(mainScript);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Disqus loader
|
|
67
|
+
createLazyLoader('disqus_thread', function(container) {
|
|
68
|
+
const shortname = container.getAttribute('data-shortname');
|
|
69
|
+
if (!shortname) {
|
|
70
|
+
console.error('Disqus shortname not provided');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
window.disqus_shortname = shortname;
|
|
75
|
+
|
|
76
|
+
const script = document.createElement('script');
|
|
77
|
+
script.type = 'text/javascript';
|
|
78
|
+
script.async = true;
|
|
79
|
+
script.src = '//' + shortname + '.disqus.com/embed.js';
|
|
80
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Giscus loader
|
|
84
|
+
createLazyLoader('giscus_thread', function(container) {
|
|
85
|
+
const script = document.createElement('script');
|
|
86
|
+
script.src = 'https://giscus.app/client.js';
|
|
87
|
+
script.async = true;
|
|
88
|
+
script.crossOrigin = 'anonymous';
|
|
89
|
+
|
|
90
|
+
// Transfer all data attributes from the container to the script
|
|
91
|
+
const attributes = container.attributes;
|
|
92
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
93
|
+
const attr = attributes[i];
|
|
94
|
+
if (attr.name.startsWith('data-') && attr.name !== 'data-lazy-load') {
|
|
95
|
+
script.setAttribute(attr.name, attr.value);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
container.appendChild(script);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Utterances loader
|
|
103
|
+
createLazyLoader('utterances_thread', function(container) {
|
|
104
|
+
const script = document.createElement('script');
|
|
105
|
+
script.src = 'https://utteranc.es/client.js';
|
|
106
|
+
script.async = true;
|
|
107
|
+
script.crossOrigin = 'anonymous';
|
|
108
|
+
|
|
109
|
+
// Transfer data attributes to script attributes (Utterances doesn't use 'data-' prefix)
|
|
110
|
+
const repo = container.getAttribute('data-repo');
|
|
111
|
+
const issueTerm = container.getAttribute('data-issue-term');
|
|
112
|
+
const theme = container.getAttribute('data-theme');
|
|
113
|
+
const label = container.getAttribute('data-label');
|
|
114
|
+
|
|
115
|
+
if (repo) script.setAttribute('repo', repo);
|
|
116
|
+
if (issueTerm) script.setAttribute('issue-term', issueTerm);
|
|
117
|
+
if (theme) script.setAttribute('theme', theme);
|
|
118
|
+
if (label) script.setAttribute('label', label);
|
|
119
|
+
|
|
120
|
+
container.appendChild(script);
|
|
121
|
+
});
|
|
122
|
+
})();
|
|
123
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){"use strict";function t(t,e){const s=document.getElementById(t);if(!s||"true"!==s.getAttribute("data-lazy-load"))return;let n=!1;function c(){n||(n=!0,e(s))}if("IntersectionObserver"in window){const t=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&(c(),t.unobserve(s))}))}),{rootMargin:"400px"});t.observe(s)}else"complete"===document.readyState?c():window.addEventListener("load",c)}t("cusdis_thread",(function(t){const e=t.getAttribute("data-lang");if(e){const t=document.createElement("script");t.src="https://cusdis.com/js/widget/lang/"+e+".js",t.async=!0,document.body.appendChild(t)}const s=document.createElement("script");s.src="https://cusdis.com/js/cusdis.es.js",s.async=!0,document.body.appendChild(s)})),t("disqus_thread",(function(t){const e=t.getAttribute("data-shortname");if(!e)return void console.error("Disqus shortname not provided");window.disqus_shortname=e;const s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src="//"+e+".disqus.com/embed.js",(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(s)})),t("giscus_thread",(function(t){const e=document.createElement("script");e.src="https://giscus.app/client.js",e.async=!0,e.crossOrigin="anonymous";const s=t.attributes;for(let t=0;t<s.length;t++){const n=s[t];n.name.startsWith("data-")&&"data-lazy-load"!==n.name&&e.setAttribute(n.name,n.value)}t.appendChild(e)})),t("utterances_thread",(function(t){const e=document.createElement("script");e.src="https://utteranc.es/client.js",e.async=!0,e.crossOrigin="anonymous";const s=t.getAttribute("data-repo"),n=t.getAttribute("data-issue-term"),c=t.getAttribute("data-theme"),a=t.getAttribute("data-label");s&&e.setAttribute("repo",s),n&&e.setAttribute("issue-term",n),c&&e.setAttribute("theme",c),a&&e.setAttribute("label",a),t.appendChild(e)}))}();
|