@@ -5,21 +5,53 @@ import Layout from "../components/layout"
55import { Seo , BannerTop } from "../components/index.js"
66import "./BlogItemDetail.scss"
77import PropTypes from "prop-types"
8+ import { Helmet } from "react-helmet"
89import { getImage , GatsbyImage } from "gatsby-plugin-image"
910
1011const BlogDetail = ( { data } ) => {
11- const { title, description, image, imagePage, author, seo } =
12+ const { title, description, image, imagePage, author, seo, published_at , updated_at } =
1213 data ?. allStrapiArticle ?. nodes [ 0 ] || { }
1314
1415 const bannerTop = imagePage ? { title, imagePage } : { title, image }
1516
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+
1643 return (
1744 < Layout >
1845 < Seo
19- title = { title }
46+ title = { seo ?. pageTitle }
2047 description = { seo ?. pageDescription }
2148 keywords = { seo ?. pageKeywords }
2249 />
50+ < Helmet >
51+ < script type = "application/ld+json" >
52+ { JSON . stringify ( structuredData ) }
53+ </ script >
54+ </ Helmet >
2355 < BannerTop banner = { bannerTop } />
2456 < div className = "detail__container row" >
2557 < div className = "col-lg-12" >
@@ -110,6 +142,8 @@ export const query = graphql`
110142 title
111143 description
112144 slug
145+ published_at
146+ updated_at
113147 seo {
114148 pageTitle
115149 pageDescription
0 commit comments