liddlelab-theme 0.0.4 → 0.0.6
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/_includes/giscus.html +4 -4
- data/_includes/postbox.html +1 -1
- data/_layouts/post.html +1 -9
- data/assets/js/paginateScroll.js +17 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2f3566d7767b3c6e536cc09381c38fced105848c8ca2fae87d30924c892aff
|
4
|
+
data.tar.gz: ba089dca4ab6f59ab8d609fb09183125cd9e2702e6ca54afe98c171de0fb160a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb3007107926d413b8ef1062a48a727ebacb1c59b974d3848b9b200ded3f5fc39a5e83372a518954f5229fd70adb7e250492263bb60ccbba61cb95623a0f030
|
7
|
+
data.tar.gz: b1a3b6839f14f44235abc99319bb4b370a5e0a8598b3462b54e8a854eb319f41c40f006ce2dfddfd6a4b0380f4c48ed7a1e8a052f92f88add5af47ebc83763ba
|
data/_includes/giscus.html
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<script src="https://giscus.app/client.js"
|
2
|
-
data-repo="
|
3
|
-
data-repo-id="
|
4
|
-
data-category="
|
5
|
-
data-category-id="
|
2
|
+
data-repo="{{ site.repo }}"
|
3
|
+
data-repo-id="{{ site.repo_id }}"
|
4
|
+
data-category="{{ site.category }}"
|
5
|
+
data-category-id="{{ site.category_id }}"
|
6
6
|
data-mapping="pathname"
|
7
7
|
data-strict="0"
|
8
8
|
data-reactions-enabled="1"
|
data/_includes/postbox.html
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
</div>
|
26
26
|
{% endif %}
|
27
27
|
</h2>
|
28
|
-
<h4 class="card-text">{{ post.
|
28
|
+
<h4 class="card-text">{{ post.description | strip_html | truncatewords:30 }}</h4>
|
29
29
|
</div>
|
30
30
|
<div class="card-footer bg-dark">
|
31
31
|
<div class="wrapfooter">
|
data/_layouts/post.html
CHANGED
@@ -141,15 +141,7 @@ post_class: post-template
|
|
141
141
|
|
142
142
|
<!-- Begin Comments
|
143
143
|
================================================== -->
|
144
|
-
{%
|
145
|
-
<div class="container">
|
146
|
-
<div id="comments" class="row justify-content-center mb-5">
|
147
|
-
<div class="col-md-8">
|
148
|
-
|
149
|
-
</div>
|
150
|
-
</div>
|
151
|
-
</div>
|
152
|
-
{% endif %}
|
144
|
+
{% include giscus.html %}
|
153
145
|
<!--End Comments
|
154
146
|
================================================== -->
|
155
147
|
|
data/assets/js/paginateScroll.js
CHANGED
@@ -4,24 +4,33 @@
|
|
4
4
|
let currentPage = 1;
|
5
5
|
let loading = false;
|
6
6
|
let hitEnd = false;
|
7
|
+
let isFirstLoad = true;
|
8
|
+
let numPostsPerPage = 0;
|
9
|
+
|
7
10
|
const loadMorePosts = async () => {
|
8
11
|
if (hitEnd) return; // Prevent loading more if we've hit the end
|
9
12
|
try {
|
10
13
|
currentPage++;
|
11
14
|
const response = await fetch(`/blog/page${currentPage}`);
|
12
15
|
if (!response.ok) throw new Error('Failed to load posts');
|
16
|
+
|
13
17
|
const newPosts = await response.text();
|
18
|
+
|
14
19
|
const parser = new DOMParser();
|
15
20
|
const doc = parser.parseFromString(newPosts, 'text/html');
|
16
21
|
const tempDiv = document.createElement('div');
|
17
22
|
tempDiv.innerHTML = doc.getElementById('postlist').innerHTML;
|
23
|
+
|
18
24
|
const postList = document.getElementById('postlist');
|
19
|
-
|
25
|
+
|
26
|
+
if (tempDiv.children.length < numPostsPerPage) {
|
20
27
|
hitEnd = true; // No more posts to load
|
21
28
|
}
|
29
|
+
|
22
30
|
while (tempDiv.firstChild) {
|
23
31
|
postList.appendChild(tempDiv.firstChild);
|
24
32
|
}
|
33
|
+
|
25
34
|
loading = false;
|
26
35
|
} catch (error) {
|
27
36
|
hitEnd = true;
|
@@ -31,7 +40,14 @@ const loadMorePosts = async () => {
|
|
31
40
|
|
32
41
|
window.addEventListener('scroll', () => {
|
33
42
|
if (loading || hitEnd) return; // Prevent multiple loads
|
43
|
+
|
34
44
|
const postList = document.getElementById('postlist');
|
45
|
+
|
46
|
+
if (isFirstLoad) {
|
47
|
+
isFirstLoad = false;
|
48
|
+
numPostsPerPage = postList.children.length;
|
49
|
+
}
|
50
|
+
|
35
51
|
if (window.innerHeight + window.scrollY >= postList.offsetTop + postList.offsetHeight - 100) {
|
36
52
|
loading = true;
|
37
53
|
loadMorePosts();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liddlelab-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Liddle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll-seo-tag
|