Skip to content

Commit

Permalink
fix: removed redundant queries. Fixes #158
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfisher committed Sep 22, 2023
1 parent 27deef0 commit 6d42453
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 85 deletions.
14 changes: 1 addition & 13 deletions site/src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ const Footer = ({slug}) => {
gatsbyImageData(layout: FULL_WIDTH)
}
}
jsFoo: file(relativePath: {eq: "posts/jsfoo.jpg"}) {
childImageSharp {
gatsbyImageData(layout: FULL_WIDTH)
}
}
podcast: file(relativePath: {eq: "posts/enterprise_ai.jpg"}) {
childImageSharp {
gatsbyImageData(layout: FULL_WIDTH)
Expand All @@ -145,6 +140,7 @@ const Footer = ({slug}) => {
featuredPosts: allMarkdownRemark(
filter: {frontmatter: {featured: {eq: true}}}
sort: {frontmatter: {date: DESC}}
limit: 2
) {
edges {
node {
Expand All @@ -160,14 +156,6 @@ const Footer = ({slug}) => {
}
listimage_position
excerpt
featureimage {
childImageSharp {
gatsbyImageData(
layout: FULL_WIDTH
)
}
}
featureimage_position
slug
}
}
Expand Down
73 changes: 1 addition & 72 deletions site/src/components/list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link, useStaticQuery, graphql} from 'gatsby';
import { Link } from 'gatsby';
import React from 'react';
import styled from 'styled-components';

Expand Down Expand Up @@ -66,82 +66,11 @@ ImageLink.defaultProps = {
$position: '50% 50%'
};


const PostDate = styled.p`
color: var(--lightened-grey);
font-size: 1.5rem !important;
`;

export const getPostImages = () => {
// returns all of the item images
// eslint-disable-next-line react-hooks/rules-of-hooks
return useStaticQuery(graphql`query postItemImageQuery {
postItemImages: allFile {
edges {
node {
relativePath
childImageSharp {
gatsbyImageData(quality: 90, layout: FULL_WIDTH)
base: gatsbyImageData(
width: 400
quality: 90
placeholder: BLURRED
layout: FIXED
)
small: fixed(width: 500, quality: 95) {
src
}
medium: fixed(width: 750, quality: 95) {
src
}
large: fixed(width: 1050, quality: 100) {
src
}
wide: fixed(width: 1600, quality: 100) {
src
}
duo_base: fixed(
width: 400
quality: 90
duotone: {highlight: "#FF5E9A", shadow: "#000000"}
) {
src
}
duo_small: fixed(
width: 500
quality: 95
duotone: {highlight: "#FF5E9A", shadow: "#000000"}
) {
src
}
duo_medium: fixed(
width: 750
quality: 95
duotone: {highlight: "#FF5E9A", shadow: "#000000"}
) {
src
}
duo_large: fixed(
width: 1050
quality: 100
duotone: {highlight: "#FF5E9A", shadow: "#000000"}
) {
src
}
duo_wide: fixed(
width: 1600
quality: 100
duotone: {highlight: "#FF5E9A", shadow: "#000000"}
) {
src
}
}
}
}
}
}`);
};

export const PostListItem = ({title, image, position, excerpt, date,
slug, readingtime, wordcount}) => {

Expand Down

0 comments on commit 6d42453

Please sign in to comment.