Skip to content

Commit 01cc7e2

Browse files
Merge pull request #325 from bitlogic/dev
Release 09-12-2025
2 parents de3bfd9 + c690c06 commit 01cc7e2

File tree

4 files changed

+70
-17
lines changed

4 files changed

+70
-17
lines changed

src/components/FaIcon/FaIcon.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
import React from "react"
22
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
3-
import "../FontAwesomeOne/FontAwesomeOne"
3+
import { faEnvelope, faLocationDot } from "@fortawesome/free-solid-svg-icons"
4+
import { faLinkedin, faTwitter, faInstagram, faYoutube, faSpotify } from "@fortawesome/free-brands-svg-icons"
45
import PropTypes from "prop-types"
56

7+
// Mapeo de los íconos que se usan
8+
const iconMap = {
9+
"fa-envelope": faEnvelope,
10+
"fa-location-dot": faLocationDot,
11+
"fa-linkedin": faLinkedin,
12+
"fa-twitter": faTwitter,
13+
"fa-instagram": faInstagram,
14+
"fa-youtube": faYoutube,
15+
"fa-spotify": faSpotify,
16+
}
17+
618
const FaIcon = ({ type, code }) => {
7-
return (
8-
<div>
9-
<FontAwesomeIcon icon={[type, code]} />
10-
</div>
11-
)
19+
const icon = iconMap[code]
20+
21+
if (!icon) {
22+
console.warn(`Icono no encontrado: type=${type}, code=${code}`)
23+
return null
24+
}
25+
26+
return <FontAwesomeIcon icon={icon} />
1227
}
1328

1429
FaIcon.propTypes = {
1530
type: PropTypes.string.isRequired,
1631
code: PropTypes.string.isRequired,
1732
}
1833

19-
export default FaIcon
34+
export default FaIcon
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { library } from '@fortawesome/fontawesome-svg-core'
2-
import { fas } from '@fortawesome/free-solid-svg-icons'
3-
import { far } from '@fortawesome/free-regular-svg-icons'
4-
import { fab } from '@fortawesome/free-brands-svg-icons'
2+
import { faEnvelope, faLocationDot } from "@fortawesome/free-solid-svg-icons"
3+
import { faLinkedin, faTwitter, faInstagram, faYoutube, faSpotify } from "@fortawesome/free-brands-svg-icons"
54

6-
library.add(fas)
7-
library.add(far)
8-
library.add(fab)
5+
library.add(faEnvelope)
6+
library.add(faLocationDot)
7+
library.add(faLinkedin)
8+
library.add(faTwitter)
9+
library.add(faInstagram)
10+
library.add(faYoutube)
11+
library.add(faSpotify)

src/components/videoBackground/VideoBackground.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function getVideoContent(video, videoRef, isIntersecting, pausePlay, handleKeyDo
106106

107107
}
108108
} else {
109-
videoContent = imageData ? <GatsbyImage className="image" image={imageData} alt={image.alternativeText || "Image"} /> : <div><br /></div>
109+
videoContent = imageData ? <GatsbyImage width={290} height={200} className="image" image={imageData} alt={image.alternativeText || "Image"} /> : <div><br /></div>
110110
}
111111

112112
return videoContent;

src/templates/BlogItemDetail.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,54 @@ import MarkdownView from "react-showdown"
44
import Layout from "../components/layout"
55
import { Seo, BannerTop, CustomImage } from "../components/index.js"
66
import PropTypes from "prop-types"
7+
import { Helmet } from "react-helmet" // Importa Helmet
78
import "./BlogItemDetail.scss"
89

910
const 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

Comments
 (0)