@@ -4,21 +4,54 @@ import MarkdownView from "react-showdown"
4
4
import Layout from "../components/layout"
5
5
import { Seo , BannerTop , CustomImage } from "../components/index.js"
6
6
import PropTypes from "prop-types"
7
+ import { Helmet } from "react-helmet" // Importa Helmet
7
8
import "./BlogItemDetail.scss"
8
9
9
10
const BlogDetail = ( { data } ) => {
10
- const { title, description, image, imagePage, author, seo } =
11
+ const { title, description, image, imagePage, author, seo, published_at , updated_at } =
11
12
data ?. allStrapiArticle ?. nodes [ 0 ] || { }
12
13
13
14
const bannerTop = imagePage ? { title, imagePage } : { title, image }
14
15
16
+ // Define datos estructurados
17
+ const structuredData = {
18
+ "@context" : "https://schema.org" ,
19
+ "@type" : "Article" ,
20
+ "headline" : seo ?. pageTitle || title , // Usa pageTitle de SEO o el título
21
+ "description" : seo ?. pageDescription || description ,
22
+ "image" : imagePage ?. url || image ?. url , // Imagen principal
23
+ "author" : author ?. map ( auth => ( {
24
+ "@type" : "Person" ,
25
+ "name" : auth . name ,
26
+ } ) ) ,
27
+ "datePublished" : published_at , // Ajusta con la fecha real
28
+ "dateModified" : updated_at , // Ajusta con la fecha real
29
+ "mainEntityOfPage" : {
30
+ "@type" : "WebPage" ,
31
+ "@id" : `https://es.bitlogic.io/blog/${ data ?. allStrapiArticle ?. nodes [ 0 ] ?. slug } ` ,
32
+ } ,
33
+ "publisher" : {
34
+ "@type" : "Organization" ,
35
+ "name" : "Bitlogic" ,
36
+ "logo" : {
37
+ "@type" : "ImageObject" ,
38
+ "url" : "https://bitlogic.io/static/64f396cb88cfcbfda46b86c5218242f2/de081/Logo_Bit_azul_7e725e9726.webp" , // URL del logo del sitio
39
+ } ,
40
+ } ,
41
+ }
42
+
15
43
return (
16
44
< Layout >
17
45
< Seo
18
- title = { title }
46
+ title = { seo ?. pageTitle }
19
47
description = { seo ?. pageDescription }
20
48
keywords = { seo ?. pageKeywords }
21
49
/>
50
+ < Helmet >
51
+ < script type = "application/ld+json" >
52
+ { JSON . stringify ( structuredData ) }
53
+ </ script >
54
+ </ Helmet >
22
55
< BannerTop banner = { bannerTop } />
23
56
< div className = "detail__container row" >
24
57
< div className = "col-lg-12" >
@@ -29,7 +62,7 @@ const BlogDetail = ({ data }) => {
29
62
/>
30
63
< div className = "detail__description-author" >
31
64
{ author ?. map ( author => (
32
- < div className = "detail__box-author" key = { author . id } >
65
+ < div className = "detail__box-author" key = { author . name } >
33
66
< div className = "detail__box-author-image" >
34
67
< CustomImage
35
68
image = { author ?. image }
@@ -112,6 +145,8 @@ export const query = graphql`
112
145
title
113
146
description
114
147
slug
148
+ published_at
149
+ updated_at
115
150
seo {
116
151
pageTitle
117
152
pageDescription
0 commit comments