diff --git a/source/content/terminus/11-updates.md b/source/content/terminus/11-updates.md
index 40b3724594..4d20bb6d60 100644
--- a/source/content/terminus/11-updates.md
+++ b/source/content/terminus/11-updates.md
@@ -1,6 +1,6 @@
---
title: Terminus Guide
-subtitle: Current Terminus Release, Changelog, and Updates
+subtitle: Terminus Changelog
description: Stay up to date on the latest Terminus version.
terminuspage: true
type: terminuspage
@@ -16,8 +16,6 @@ product: [terminus]
integration: [--]
---
-
-
## Changelog
diff --git a/src/components/releases.js b/src/components/releases.js
index 36f6c33776..e8d7474728 100644
--- a/src/components/releases.js
+++ b/src/components/releases.js
@@ -1,49 +1,61 @@
-import React from "react"
-import { StaticQuery, graphql } from "gatsby"
-import { MDXRenderer } from "gatsby-plugin-mdx"
-import { MDXProvider } from "@mdx-js/react"
+import React from 'react';
+import { StaticQuery, graphql } from 'gatsby';
+import { MDXRenderer } from 'gatsby-plugin-mdx';
+import { MDXProvider } from '@mdx-js/react';
+import { subYears, parseISO, isAfter } from 'date-fns';
-import { headline1, headline2, headline3 } from "./releaseHeadlines"
+import { headline1, headline2, headline3 } from './releaseHeadlines';
const shortcodes = {
h1: headline1,
h2: headline2,
h3: headline3,
-}
+};
-const Releases = ({ data }) => (
- <>
- {data.allTerminusReleasesJson.edges.map((release, i) => {
- return (
-
-
- {release.node.tag_name}
-
-
-
- {release.node.fields.markdownBody.childMdx.body}
-
-
-
-
- )
- })}
- >
-)
+const Releases = ({ data }) => {
+ const oneYearAgo = subYears(new Date(), 1);
-export default props => (
+ // Safe Filtering: Ensure `published_at` exists before filtering
+ const filteredReleases = data.allTerminusReleasesJson.edges.filter(
+ (release) => {
+ const publishedDate = release.node.published_at;
+ return publishedDate && isAfter(parseISO(publishedDate), oneYearAgo);
+ },
+ );
+
+ return (
+ <>
+ {filteredReleases.length > 0 ? (
+ filteredReleases.map((release, i) => (
+
+
+ {release.node.tag_name}
+
+
+
+ {release.node.fields.markdownBody.childMdx.body}
+
+
+
+
+ ))
+ ) : (
+ No recent releases found.
+ )}
+ >
+ );
+};
+
+export default (props) => (
(
}
}
`}
- render={data => }
+ render={(data) => }
/>
-)
+);
diff --git a/src/components/terminusVersion.js b/src/components/terminusVersion.js
index 53229fbe7e..52910b2408 100644
--- a/src/components/terminusVersion.js
+++ b/src/components/terminusVersion.js
@@ -1,22 +1,26 @@
-import React from "react"
-import { useStaticQuery, graphql } from "gatsby"
+import React from 'react';
+import { useStaticQuery, graphql } from 'gatsby';
function TerminusVersion({ text }) {
- const { terminusReleasesJson } = useStaticQuery(
- graphql`
- query {
- terminusReleasesJson {
- tag_name
+ const { allTerminusReleasesJson } = useStaticQuery(graphql`
+ query {
+ allTerminusReleasesJson(sort: { fields: [published_at], order: DESC }) {
+ edges {
+ node {
+ tag_name
+ }
}
}
- `
- )
+ }
+ `);
+
+ const latestRelease = allTerminusReleasesJson.edges[0].node.tag_name;
return (
- {text} {terminusReleasesJson.tag_name}
+ {text} {latestRelease}
- )
+ );
}
-export default TerminusVersion
+export default TerminusVersion;
diff --git a/src/templates/terminusCommand.js b/src/templates/terminusCommand.js
index a2f17aadd4..faeb4a32de 100644
--- a/src/templates/terminusCommand.js
+++ b/src/templates/terminusCommand.js
@@ -70,7 +70,7 @@ const items = [
{
id: 'docs-terminus-updates',
link: '/terminus/updates',
- title: 'Current Terminus Release and Changelog',
+ title: 'Terminus Changelog',
},
{
diff --git a/src/templates/terminuspage.js b/src/templates/terminuspage.js
index 655f838b98..9086ef4e57 100644
--- a/src/templates/terminuspage.js
+++ b/src/templates/terminuspage.js
@@ -71,7 +71,7 @@ const items = [
{
id: 'docs-terminus-updates',
link: '/terminus/updates',
- title: 'Current Terminus Release and Changelog',
+ title: 'Terminus Changelog',
},
{