Skip to content

Commit

Permalink
Revert "Reverting the prefetch page and adding lazy loading"
Browse files Browse the repository at this point in the history
This reverts commit d804cbb.
  • Loading branch information
amankumarrr committed Oct 1, 2024
1 parent 58139bf commit 2df1dd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
21 changes: 10 additions & 11 deletions app/page-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ import { TinaMarkdown } from "tinacms/dist/rich-text";
export default function PageContent({ props }) {
const { data } = props;

const structuredData: WithContext<WebSite> = {
"@context": "https://schema.org",
"@type": "WebSite",
name: props?.data.global?.header.site_name,
alternateName: props?.data.global?.header?.alternate_site_name,
description: props?.data.global.header.description,
url: props?.data.global.header.url,
};

const contentClass = data.page.sideBar
? "max-w-full md:col-span-3 prose prose-h2:text-3xl/9 prose-h2:text-black"
: "max-w-full md:col-span-5 prose prose-h2:text-3xl/9 prose-h2:text-black";

useEffect(() => {
const structuredData: WithContext<WebSite> = {
"@context": "https://schema.org",
"@type": "WebSite",
name: props?.data.global?.header.site_name,
alternateName: props?.data.global?.header?.alternate_site_name,
description: props?.data.global.header.description,
url: props?.data.global.header.url,
};

const script = document.createElement("script");
script.type = "application/ld+json";
script.text = JSON.stringify(structuredData);
Expand All @@ -37,8 +37,7 @@ export default function PageContent({ props }) {
return () => {
document.head.removeChild(script);
};
}, [props?.data.global.header]);

}, [structuredData]);
return (
<>
{data.page.breadcrumbs && (
Expand Down
5 changes: 0 additions & 5 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ const config = {
destination: "/admin/index.html",
permanent: true,
},
{
source: "/consulting/artificial-intelligence",
destination: "/ai",
permanent: true,
},
];
},
experimental: {
Expand Down

0 comments on commit 2df1dd2

Please sign in to comment.