Add hero image captions to posts. Commented out for events for now.
This commit is contained in:
1 parent
93a0184ec6
commit
0c9e0053e9
2 files changed
+31
-8
No files matched your search
+15
-4
@@ -116,9 +116,17 @@ export const EventTemplate = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{hasFeaturedMedia && (
|
{hasFeaturedMedia && (
|
||||||
<div className="event-hero_image">
|
<>
|
||||||
<Img fluid={featuredMedia.localFile.childImageSharp.fluid} />
|
<div className="event-hero_image">
|
||||||
</div>
|
<Img fluid={featuredMedia.localFile.childImageSharp.fluid} />
|
||||||
|
</div>
|
||||||
|
{/* {featuredMedia.caption && (
|
||||||
|
<div
|
||||||
|
className="event-hero_image-caption"
|
||||||
|
dangerouslySetInnerHTML={{ __html: featuredMedia.caption }}
|
||||||
|
/>
|
||||||
|
)} */}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,7 +158,9 @@ export const EventTemplate = ({
|
|||||||
EventTemplate.propTypes = {
|
EventTemplate.propTypes = {
|
||||||
content: PropTypes.node.isRequired,
|
content: PropTypes.node.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
featuredMedia: PropTypes.shape({}),
|
featuredMedia: PropTypes.shape({
|
||||||
|
caption: PropTypes.string,
|
||||||
|
}),
|
||||||
startTime: PropTypes.string.isRequired,
|
startTime: PropTypes.string.isRequired,
|
||||||
endTime: PropTypes.string,
|
endTime: PropTypes.string,
|
||||||
venue: PropTypes.shape({
|
venue: PropTypes.shape({
|
||||||
@@ -225,6 +235,7 @@ export const eventQuery = graphql`
|
|||||||
price_member
|
price_member
|
||||||
price_regular
|
price_regular
|
||||||
featured_media {
|
featured_media {
|
||||||
|
caption
|
||||||
localFile {
|
localFile {
|
||||||
...FluidImage
|
...FluidImage
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-4
@@ -39,9 +39,18 @@ export const BlogPostTemplate = ({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{hasFeaturedMedia && (
|
{hasFeaturedMedia && (
|
||||||
<div className="post-hero_image">
|
<>
|
||||||
<Img fluid={featuredMedia.localFile.childImageSharp.fluid} />
|
<div className="post-hero_image">
|
||||||
</div>
|
<Img fluid={featuredMedia.localFile.childImageSharp.fluid} />
|
||||||
|
{featuredMedia.caption && (
|
||||||
|
<div
|
||||||
|
className="post-hero_image-caption"
|
||||||
|
dangerouslySetInnerHTML={{ __html: featuredMedia.caption }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className="post-content wp-content"
|
className="post-content wp-content"
|
||||||
@@ -55,7 +64,9 @@ BlogPostTemplate.propTypes = {
|
|||||||
content: PropTypes.node.isRequired,
|
content: PropTypes.node.isRequired,
|
||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
date: PropTypes.string.isRequired,
|
date: PropTypes.string.isRequired,
|
||||||
featuredMedia: PropTypes.shape({}),
|
featuredMedia: PropTypes.shape({
|
||||||
|
caption: PropTypes.string,
|
||||||
|
}),
|
||||||
author: PropTypes.shape({
|
author: PropTypes.shape({
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
slug: PropTypes.string,
|
slug: PropTypes.string,
|
||||||
@@ -124,6 +135,7 @@ export const pageQuery = graphql`
|
|||||||
slug
|
slug
|
||||||
}
|
}
|
||||||
featured_media {
|
featured_media {
|
||||||
|
caption
|
||||||
localFile {
|
localFile {
|
||||||
...FluidImage
|
...FluidImage
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user