From cdaacf2ec5fed7527059ac2c796e280e40f31cf4 Mon Sep 17 00:00:00 2001 From: phartenfeller Date: Fri, 16 Feb 2024 13:10:29 +0100 Subject: [PATCH] lazy load other posts --- src/templates/blog-page-template.jsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/templates/blog-page-template.jsx b/src/templates/blog-page-template.jsx index 1b37c2f..2654b39 100644 --- a/src/templates/blog-page-template.jsx +++ b/src/templates/blog-page-template.jsx @@ -8,7 +8,6 @@ import React, { Suspense } from 'react'; import LinkButton from '../components/LinkButton'; import AuthorShowcase from '../components/blog/AuthorShowcase'; import BlogImagePopup from '../components/blog/BlogImagePopup'; -import OtherPosts from '../components/blog/OtherPosts'; import ScrollTracker from '../components/blog/ScrollTracker'; import TagsDisplay from '../components/blog/TagsDisplay'; import BlogAPEXSidebar from '../components/blog/blogAPEXSidebar'; @@ -18,7 +17,8 @@ import SEO from '../components/seo'; import '../styles/blog.css'; import lazyLoad from '../util/lazy'; -const Comments = lazyLoad(() => import('../components/blog/Comments'), 1); +const Comments = lazyLoad(() => import('../components/blog/Comments'), 2.5); +const OtherPosts = lazyLoad(() => import('../components/blog/OtherPosts'), 2.5); export const query = graphql` query ($id: String!, $relativeDirectory: String!) { @@ -233,10 +233,6 @@ const BlogPageTemplate = ({ data }) => { ) : null} -
- -
-
{ />
+ +

+ Other Posts +

+
+ Loading...
}> + + +
{ghCommentsIssueId && ( <>