@@ -4,21 +4,54 @@ import MarkdownView from "react-showdown"
44import Layout from "../components/layout"
55import { Seo , BannerTop , CustomImage } from "../components/index.js"
66import PropTypes from "prop-types"
7+ import { Helmet } from "react-helmet" // Importa Helmet
78import "./BlogItemDetail.scss"
89
910const BlogDetail = ( { data } ) => {
10- const { title, description, image, imagePage, author, seo } =
11+ const { title, description, image, imagePage, author, seo, published_at , updated_at } =
1112 data ?. allStrapiArticle ?. nodes [ 0 ] || { }
1213
1314 const bannerTop = imagePage ? { title, imagePage } : { title, image }
1415
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+
1543 return (
1644 < Layout >
1745 < Seo
18- title = { title }
46+ title = { seo ?. pageTitle }
1947 description = { seo ?. pageDescription }
2048 keywords = { seo ?. pageKeywords }
2149 />
50+ < Helmet >
51+ < script type = "application/ld+json" >
52+ { JSON . stringify ( structuredData ) }
53+ </ script >
54+ </ Helmet >
2255 < BannerTop banner = { bannerTop } />
2356 < div className = "detail__container row" >
2457 < div className = "col-lg-12" >
@@ -29,7 +62,7 @@ const BlogDetail = ({ data }) => {
2962 />
3063 < div className = "detail__description-author" >
3164 { author ?. map ( author => (
32- < div className = "detail__box-author" key = { author . id } >
65+ < div className = "detail__box-author" key = { author . name } >
3366 < div className = "detail__box-author-image" >
3467 < CustomImage
3568 image = { author ?. image }
@@ -112,6 +145,8 @@ export const query = graphql`
112145 title
113146 description
114147 slug
148+ published_at
149+ updated_at
115150 seo {
116151 pageTitle
117152 pageDescription
0 commit comments