Skip to content

Commit

Permalink
maybe fix filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Dec 17, 2024
1 parent d5d22f2 commit 73b4cbb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/components/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ const shortcodes = {
const Releases = ({ data }) => {
const oneYearAgo = subYears(new Date(), 1);

// Filter releases that are newer than one year
// Filter releases published within the last year
const filteredReleases = data.allTerminusReleasesJson.edges.filter(
(release) =>
isAfter(
parseISO(release.node.fields.markdownBody.childMdx.body.published_at),
oneYearAgo,
),
(release) => {
const publishedDate = release.node.published_at;
return publishedDate && isAfter(parseISO(publishedDate), oneYearAgo);
}
);

return (
Expand All @@ -32,9 +31,7 @@ const Releases = ({ data }) => {
{release.node.tag_name}
</h3>
<MDXProvider components={shortcodes}>
<MDXRenderer>
{release.node.fields.markdownBody.childMdx.body}
</MDXRenderer>
<MDXRenderer>{release.node.fields.markdownBody.childMdx.body}</MDXRenderer>
</MDXProvider>
<hr />
</div>
Expand All @@ -52,6 +49,7 @@ export default (props) => (
node {
id
tag_name
published_at
fields {
markdownBody {
childMdx {
Expand Down

0 comments on commit 73b4cbb

Please sign in to comment.