liddlelab-theme 0.0.4 → 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 +4 -4
- data/_includes/giscus.html +4 -4
- 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: 92e3deeb597654517ae3c7cbbf4f1d3e0939964d2556517709f3c81e8c5f9440
         | 
| 4 | 
            +
              data.tar.gz: 6742c65bd69ba9e4d9c6237f98f3f9553f60b462698ae4ccf1f027686fc28aab
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 42d64a153d71067789e03932b7fdf8ccd3739e9c0135d424c0ec6903b851c0043aca699ba5b2125af1e14b93129c2612b9ce6af83836e24287b2a43a3aca8235
         | 
| 7 | 
            +
              data.tar.gz: 6e07b637bcd6cd91a36a4eb702ba9495f60191115c5f5089eb4d302cc67d94d546251be4fdada485401712f00bc112747e17e73b5e11355ae181c270ec68fed6
         | 
    
        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/_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.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- | 
| 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
         |