Skip to content

Commit 103080a

Browse files
committed
rollback
1 parent 0017f48 commit 103080a

File tree

1 file changed

+5
-49
lines changed

1 file changed

+5
-49
lines changed

src/templates/LandingPage.js

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,26 @@
11
import React, { useRef } from "react"
22
import { graphql } from "gatsby"
3+
import Layout from "../components/layout"
4+
import { CustomSection, Seo, Navigation } from "../components/index"
35
import PropTypes from "prop-types"
4-
import { Helmet } from "react-helmet"
5-
import { Seo, CustomSection, Navigation, Layout } from "../components"
66

77
const LandingPage = ({ data, location }) => {
88
const { name, slug, parent_page, seo, body, navigation } =
99
data?.allStrapiLandingPage?.nodes[0] || {}
1010

1111
const wrapperRef = useRef(null)
12-
13-
const faqs = (body || [])
14-
.filter(block => block.strapi_component === "components.banner-list")
15-
.flatMap(block =>
16-
(block.Card || [])
17-
.filter(card => card.description && card.description.trim() !== "")
18-
.map(({ id, title, description }) => ({
19-
"@type": "Question",
20-
name: title,
21-
acceptedAnswer: {
22-
"@type": "Answer",
23-
text: description,
24-
},
25-
"@id": `#faq-${id}`,
26-
}))
27-
)
28-
const pageLd = {
29-
"@context": "https://schema.org",
30-
"@type": "WebPage",
31-
name: seo?.pageTitle || name,
32-
description: seo?.pageDescription,
33-
url: `https://en.bitlogic.io/${slug}`,
34-
}
35-
const faqLd =
36-
faqs.length > 0
37-
? {
38-
"@context": "https://schema.org",
39-
"@type": "FAQPage",
40-
mainEntity: faqs,
41-
}
42-
: null
43-
4412
const landing = {
4513
name,
4614
slug,
4715
parent_page,
4816
ref: wrapperRef,
4917
}
5018

19+
const {pageTitle, pageKeywords, pageDescription } = seo || {}
20+
5121
return (
5222
<Layout location={location} options={{ hasHeader: true }}>
53-
<Seo
54-
title={seo?.pageTitle || name}
55-
description={seo?.pageDescription}
56-
keywords={seo?.pageKeywords}
57-
/>
58-
<Helmet>
59-
<script type="application/ld+json">
60-
{JSON.stringify(pageLd)}
61-
</script>
62-
{faqLd && (
63-
<script type="application/ld+json">
64-
{JSON.stringify(faqLd)}
65-
</script>
66-
)}
67-
</Helmet>
23+
<Seo title={pageTitle} description={pageDescription} keywords={pageKeywords} location={location} />
6824
{body?.length > 0 && navigation ? (
6925
<>
7026
<CustomSection sections={body.slice(0, 1)} />

0 commit comments

Comments
 (0)