diff --git a/src/blogTemplates/blogPost.js b/src/blogTemplates/blogPost.js index a939b8fe..09d8ab92 100644 --- a/src/blogTemplates/blogPost.js +++ b/src/blogTemplates/blogPost.js @@ -1,7 +1,6 @@ import React from "react"; import { graphql } from "gatsby"; import { changeLocale } from "gatsby-plugin-react-intl"; -import { useEffect } from "react"; import styled from 'styled-components' import Img from "gatsby-image" import data from '../content/content.json' @@ -114,7 +113,6 @@ const PostContent = styled.div` p{ margin-bottom:30px; } - h2{ font-size: .88rem; line-height: 23px; @@ -122,7 +120,9 @@ const PostContent = styled.div` font-weight: ${styles.fontWeight.bold}; margin-bottom: 20px; } - + h1, h2, h3, h4, h5, h6 { + margin-bottom: 15px; + } figure{ margin-bottom: 30px; max-width: 320px; @@ -202,18 +202,23 @@ const TagsTitle = styled.h4` const Btn = styled(Button)` display: flex; justify-content: center; + width: fit-content; + margin-left: auto; + margin-right: auto; ` -export default function Post({ data, props }) { +export default function Post({ data: {allMarkdownRemark: { edges }} }) { deckDeckGoHighlightElement(); - const { html, frontmatter: post } = data.markdownRemark; const intl = useIntl(); - - useEffect(() => { - if (post.lang !== "es") { - changeLocale(post.lang); - } - }, [post.lang]); + let post = edges[0].node.frontmatter; + let html = ""; + const postFiqus = edges.forEach((e) => { + const { frontmatter: p } = e.node; + if (p.lang === intl.locale) { + post = p; + html = e.node.html; + } + }) return ( @@ -225,7 +230,7 @@ export default function Post({ data, props }) { - Blog {post.title} + Blog / {post.title} @@ -257,28 +262,34 @@ export default function Post({ data, props }) { ); } + export const pageQuery = graphql` - query PostQuery($slug: String!) { - markdownRemark(frontmatter: { slug: { eq: $slug } }) { - html - frontmatter { - lang - type - title - author - slug - date - tags - image{ - childImageSharp { - fluid(maxWidth: 800) { - ...GatsbyImageSharpFluid + query ($slug: String!) { + allMarkdownRemark(filter: {frontmatter: { type: {eq: "post"}, slug: { eq: $slug } }}){ + edges { + node { + id + html + frontmatter { + lang + type + title + author + slug + date + tags + image{ + childImageSharp { + fluid(maxWidth: 800) { + ...GatsbyImageSharpFluid + } + } } + imageCredits } + timeToRead } - imageCredits } - timeToRead } } `; diff --git a/src/components/common/SectionHeader.js b/src/components/common/SectionHeader.js index cb77bfff..ec9dabae 100644 --- a/src/components/common/SectionHeader.js +++ b/src/components/common/SectionHeader.js @@ -84,6 +84,28 @@ const ImageContainer = styled.div` margin-right: 17px;` } }} + ${props => { + if (props.section === 'labs') { + return ` + svg { + width: 100%!important; + height: auto!important; + } + ` + } + }} + } + @media (min-width: ${styles.breakpoints.m}px) and (max-width: ${styles.breakpoints.l}px){ + ${props => { + if (props.section === 'cultura') { + return ` + svg { + width: 100%!important; + height: auto!important; + } + ` + } + }} } ` diff --git a/src/components/modules/FeaturedService.js b/src/components/modules/FeaturedService.js index 921f5a92..d1f47b63 100644 --- a/src/components/modules/FeaturedService.js +++ b/src/components/modules/FeaturedService.js @@ -300,7 +300,7 @@ const FeaturedService = (props) => {