liddlelab-theme 0.0.3 → 0.0.5

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: ad6069cda5f397b2a724d02d4a3c942f0a25673b7d94227dad5cac066370dc3c
4
- data.tar.gz: 7ef5f11d0cf14249c9c3f022f072c3805f855844648f168b96c7adfbd2224f6c
3
+ metadata.gz: 92e3deeb597654517ae3c7cbbf4f1d3e0939964d2556517709f3c81e8c5f9440
4
+ data.tar.gz: 6742c65bd69ba9e4d9c6237f98f3f9553f60b462698ae4ccf1f027686fc28aab
5
5
  SHA512:
6
- metadata.gz: e7f965639c9f9161bc0db2b5d835d8ac3b15fc47f8e47053a7b84bbdb1a4325cc7c76ab82010a8d19e16f8ca3ab2a075eba2a16e32c54941fa51d60cb653cafe
7
- data.tar.gz: 76eee0f604a07d1e44b9fc4b90aed18fd3ca94263df3d223c94ad47260894fbdbb2cc847bc5a2767f3d3c3ed61167ae6e1b35f63176c43ff213ec2963a85f0b5
6
+ metadata.gz: 42d64a153d71067789e03932b7fdf8ccd3739e9c0135d424c0ec6903b851c0043aca699ba5b2125af1e14b93129c2612b9ce6af83836e24287b2a43a3aca8235
7
+ data.tar.gz: 6e07b637bcd6cd91a36a4eb702ba9495f60191115c5f5089eb4d302cc67d94d546251be4fdada485401712f00bc112747e17e73b5e11355ae181c270ec68fed6
@@ -1,8 +1,8 @@
1
1
  <script src="https://giscus.app/client.js"
2
- data-repo="[ENTER REPO HERE]"
3
- data-repo-id="[ENTER REPO ID HERE]"
4
- data-category="[ENTER CATEGORY NAME HERE]"
5
- data-category-id="[ENTER CATEGORY ID HERE]"
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/_layouts/post.html CHANGED
@@ -122,10 +122,10 @@ post_class: post-template
122
122
  <!-- Prev/Next -->
123
123
  <div class="row PageNavigation d-flex justify-content-between font-weight-bold">
124
124
  {% if page.previous.url %}
125
- <a class="prev d-block col-md-6" href="{{ site.baseurl }}/{{page.previous.url}}"> &laquo; {{page.previous.title}}</a>
125
+ <a class="prev d-block col-md-6" href="{{page.previous.url}}"> &laquo; {{page.previous.title}}</a>
126
126
  {% endif %}
127
127
  {% if page.next.url %}
128
- <a class="next d-block col-md-6 text-lg-right" href="{{ site.baseurl }}/{{page.next.url}}">{{page.next.title}} &raquo; </a>
128
+ <a class="next d-block col-md-6 text-lg-right" href="{{page.next.url}}">{{page.next.title}} &raquo; </a>
129
129
  {% endif %}
130
130
  <div class="clearfix"></div>
131
131
  </div>
@@ -141,15 +141,7 @@ post_class: post-template
141
141
 
142
142
  <!-- Begin Comments
143
143
  ================================================== -->
144
- {% if page.comments != false %}
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
 
@@ -0,0 +1,55 @@
1
+ // identify our page number statically
2
+ // get ready to load the next page
3
+ // on a scroll down, load the next page of results and append it in the #postlist container
4
+ let currentPage = 1;
5
+ let loading = false;
6
+ let hitEnd = false;
7
+ let isFirstLoad = true;
8
+ let numPostsPerPage = 0;
9
+
10
+ const loadMorePosts = async () => {
11
+ if (hitEnd) return; // Prevent loading more if we've hit the end
12
+ try {
13
+ currentPage++;
14
+ const response = await fetch(`/blog/page${currentPage}`);
15
+ if (!response.ok) throw new Error('Failed to load posts');
16
+
17
+ const newPosts = await response.text();
18
+
19
+ const parser = new DOMParser();
20
+ const doc = parser.parseFromString(newPosts, 'text/html');
21
+ const tempDiv = document.createElement('div');
22
+ tempDiv.innerHTML = doc.getElementById('postlist').innerHTML;
23
+
24
+ const postList = document.getElementById('postlist');
25
+
26
+ if (tempDiv.children.length < numPostsPerPage) {
27
+ hitEnd = true; // No more posts to load
28
+ }
29
+
30
+ while (tempDiv.firstChild) {
31
+ postList.appendChild(tempDiv.firstChild);
32
+ }
33
+
34
+ loading = false;
35
+ } catch (error) {
36
+ hitEnd = true;
37
+ console.error('Error loading more posts:', error);
38
+ }
39
+ };
40
+
41
+ window.addEventListener('scroll', () => {
42
+ if (loading || hitEnd) return; // Prevent multiple loads
43
+
44
+ const postList = document.getElementById('postlist');
45
+
46
+ if (isFirstLoad) {
47
+ isFirstLoad = false;
48
+ numPostsPerPage = postList.children.length;
49
+ }
50
+
51
+ if (window.innerHeight + window.scrollY >= postList.offsetTop + postList.offsetHeight - 100) {
52
+ loading = true;
53
+ loadMorePosts();
54
+ }
55
+ });
data/blog/index.html CHANGED
@@ -2,53 +2,16 @@
2
2
  layout: default
3
3
  title: Blog
4
4
  ---
5
-
6
- <section class="featured-posts">
7
- <div class="section-title">
8
- <h2><span>Featured</span></h2>
9
- </div>
10
- <div class="row">
11
-
12
- {% for post in site.posts %}
13
-
14
- {% if post.featured == true %}
15
-
16
- {% include featuredbox.html %}
17
-
18
- {% endif %}
19
-
20
- {% endfor %}
21
-
22
- </div>
23
- </section>
24
-
5
+ <script src="/assets/js/paginateScroll.js"></script>
25
6
  <!-- Posts Index
26
7
  ================================================== -->
27
8
  <section class="recent-posts">
28
-
29
9
  <div class="section-title">
30
-
31
- <h2><span>All Stories</span></h2>
32
-
10
+ <h2><span>Articles</span></h2>
33
11
  </div>
34
-
35
- <div class="row listrecent">
36
-
12
+ <div class="row listrecent" id="postlist">
37
13
  {% for post in paginator.posts %}
38
-
39
14
  {% include postbox.html %}
40
-
41
15
  {% endfor %}
42
-
43
16
  </div>
44
-
45
- </section>
46
-
47
- <!-- Pagination
48
- ================================================== -->
49
- <div class="bottompagination">
50
- <div class="pointerup"><i class="fa fa-caret-up"></i></div>
51
- <span class="navigation" role="navigation">
52
- {% include pagination.html %}
53
- </span>
54
- </div>
17
+ </section>
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.3
4
+ version: 0.0.5
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-24 00:00:00.000000000 Z
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
@@ -172,6 +172,7 @@ files:
172
172
  - assets/img/sample2.jpg
173
173
  - assets/js/lunr.js
174
174
  - assets/js/lunrsearchengine.js
175
+ - assets/js/paginateScroll.js
175
176
  - blog/index.html
176
177
  homepage: https://liddlelaboratory.com
177
178
  licenses: