Skip to content

Commit

Permalink
Merge pull request #5129 from vishalvivekm/screenshots-fix
Browse files Browse the repository at this point in the history
prevent-overwriting-of-screenshots
  • Loading branch information
leecalcote committed Nov 21, 2023
2 parents dbbdf02 + bc8c529 commit 09888ec
Show file tree
Hide file tree
Showing 39 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions gatsby-node.js
Expand Up @@ -429,6 +429,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
component: integrationTemplate,
context: {
slug: integration.fields.slug,
name: "_images/" + integration.fields.slug.split("/")[2],
},
});
});
Expand Down
Expand Up @@ -11,6 +11,9 @@ import RelatedIntegration from "../IntegrationsGrid";
const IndividualIntegrations = ({ data }) => {
const { frontmatter, body } = data.mdx;

const screenshotNodes = data.allFile.nodes;
const finalScreenshots = screenshotNodes.length === 0 ? frontmatter.workingSlides : screenshotNodes;

return (
<IntegrationPageWrapper>
<section className="herosection">
Expand Down Expand Up @@ -45,7 +48,7 @@ const IndividualIntegrations = ({ data }) => {
</section>
</div>
</section>
<HowIntegrationWorks name={frontmatter.title} howitworks={frontmatter.howItWorks} howitworksdetails={frontmatter.howItWorksDetails} slides={frontmatter.workingSlides} />
<HowIntegrationWorks name={frontmatter.title} howitworks={frontmatter.howItWorks} howitworksdetails={frontmatter.howItWorksDetails} slides={finalScreenshots} />
<section className="integration-collection">
<h2>Related Integrations</h2>
<RelatedIntegration category={frontmatter.category} />
Expand Down
13 changes: 12 additions & 1 deletion src/templates/integrations.js
Expand Up @@ -8,7 +8,7 @@ import IndividualIntegrations from "../sections/Meshery/Meshery-integrations/Ind


export const query = graphql`
query IntegrationsBySlug($slug: String!) {
query IntegrationsBySlug($slug: String!, $name: String!) {
mdx(fields:{slug:{eq: $slug}}) {
body
frontmatter {
Expand All @@ -35,6 +35,17 @@ export const query = graphql`
}
}
}
allFile(
filter: {relativeDirectory: {eq: $name}, sourceInstanceName: {eq: "integrations"}}
) {
nodes {
childImageSharp {
gatsbyImageData(layout: FULL_WIDTH)
}
extension
publicURL
}
}
}
`;
const Integrations = ({ data }) => {
Expand Down

0 comments on commit 09888ec

Please sign in to comment.