import * as React from "react";
import { graphql } from "gatsby";
import { GatsbyImage, getImage } from "gatsby-plugin-image";
import { Section, Label } from "../components/Layout";
import { NewsSummary } from "../components/News";
import Link from "../components/Link";
import Seo from "../components/seo";
const NewsCard = ({ ...props }) => {
const linkProps = { to: !props.frontmatter.external && props.fields.slug, href: props.frontmatter.external };
return (
{props.frontmatter.categories && (
{props.frontmatter.categories.map((category) => (
))}
)}
{props.frontmatter.title}
{props.frontmatter.description && (
{props.frontmatter.description}
)}
);
};
const NewsPage = ({ data }) => {
return (
<>
{data.allMarkdownRemark.edges.map(({ node }) => (
))}
>
);
};
export const query = graphql`
query NewsQuery {
allMarkdownRemark(
filter: { frontmatter: { hidden: { ne: true } } }
sort: { fields: frontmatter___date, order: DESC }
) {
edges {
node {
id
frontmatter {
title
date(formatString: "MMMM DD, YYYY")
description
author
categories
external
thumbnail {
childImageSharp {
gatsbyImageData(width: 320, height: 170, placeholder: BLURRED, formats: [AUTO, WEBP, AVIF])
}
}
avatar {
childImageSharp {
gatsbyImageData(width: 40, placeholder: BLURRED, formats: [AUTO, WEBP, AVIF])
}
}
}
fields {
slug
}
}
}
}
}
`;
export default NewsPage;