From d0dba6dbf2c7d60eaf00c377bb79deb9d39c949e Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Thu, 25 May 2023 11:37:12 -0400 Subject: [PATCH] docs: update releases page --- packages/docs/content/releases.json | 123 +++++++++++++++++++++++++++ packages/docs/src/interface.ts | 3 +- packages/docs/src/pages/index.tsx | 9 +- packages/docs/src/pages/releases.tsx | 39 +++++---- 4 files changed, 152 insertions(+), 22 deletions(-) diff --git a/packages/docs/content/releases.json b/packages/docs/content/releases.json index 72a58aa0..520737eb 100644 --- a/packages/docs/content/releases.json +++ b/packages/docs/content/releases.json @@ -1,43 +1,166 @@ { "releases": [ + { + "date": "2023-05-25T10:00:00.000Z", + "version": "v2.4.2", + "type": "patch" + }, + { + "date": "2023-05-25T10:00:00.000Z", + "version": "v2.4.1", + "type": "patch" + }, { "date": "2023-05-24T11:00:00.000Z", "version": "v2.4.0", + "type": "minor", "description": "Delimiter separated lists and expanded folder filter support" }, + { + "date": "2023-05-18T10:00:00.000Z", + "version": "v2.3.4", + "type": "patch" + }, + { + "date": "2023-05-16T10:00:00.000Z", + "version": "v2.3.3", + "type": "patch" + }, + { + "date": "2023-05-15T10:00:00.000Z", + "version": "v2.3.2", + "type": "patch" + }, + { + "date": "2023-05-12T10:00:00.000Z", + "version": "v2.3.1", + "type": "patch" + }, { "date": "2023-05-12T10:53:00.000Z", "version": "v2.3.0", + "type": "minor", "description": "File drag and drop support for File and Image widgets" }, { "date": "2023-05-05T23:00:00.000Z", "version": "v2.2.0", + "type": "minor", "description": "Multi image support and markdown toolbar customization" }, { "date": "2023-04-25T14:28:00.000Z", "version": "v2.1.0", + "type": "minor", "description": "Prefix option for UUID widget." }, + { + "date": "2023-04-21T10:00:00.000Z", + "version": "v2.0.1", + "type": "patch" + }, { "date": "2023-04-21T15:00:00.000Z", "version": "v2.0.0", + "type": "major", "description": "New UI and Media Library enchancements." }, + { + "date": "2023-03-31T10:00:00.000Z", + "version": "v1.2.14", + "type": "patch" + }, + { + "date": "2023-03-30T10:00:00.000Z", + "version": "v1.2.13", + "type": "patch" + }, + { + "date": "2023-02-27T10:00:00.000Z", + "version": "v1.2.11", + "type": "patch" + }, + { + "date": "2023-02-24T10:00:00.000Z", + "version": "v1.2.10", + "type": "patch" + }, + { + "date": "2023-02-24T10:00:00.000Z", + "version": "v1.2.9", + "type": "patch" + }, + { + "date": "2023-02-08T10:00:00.000Z", + "version": "v1.2.8", + "type": "patch" + }, + { + "date": "2023-02-06T10:00:00.000Z", + "version": "v1.2.7", + "type": "patch" + }, + { + "date": "2023-01-29T10:00:00.000Z", + "version": "v1.2.6", + "type": "patch" + }, + { + "date": "2023-01-28T10:00:00.000Z", + "version": "v1.2.5", + "type": "patch" + }, + { + "date": "2023-01-27T10:00:00.000Z", + "version": "v1.2.4", + "type": "patch" + }, + { + "date": "2023-01-26T10:00:00.000Z", + "version": "v1.2.3", + "type": "patch" + }, + { + "date": "2023-01-25T10:00:00.000Z", + "version": "v1.2.2", + "type": "patch" + }, + { + "date": "2023-01-25T10:00:00.000Z", + "version": "v1.2.1", + "type": "patch" + }, { "date": "2023-01-25T15:26:00.000Z", "version": "v1.2.0", + "type": "minor", "description": "Custom collection card templates." }, + { + "date": "2023-01-24T10:00:00.000Z", + "version": "v1.1.3", + "type": "patch" + }, + { + "date": "2023-01-23T10:00:00.000Z", + "version": "v1.1.2", + "type": "patch" + }, + { + "date": "2023-01-22T10:00:00.000Z", + "version": "v1.1.1", + "type": "patch" + }, { "date": "2023-01-18T15:44:00.000Z", "version": "v1.1.0", + "type": "minor", "description": "Gitea backend beta support. Side by side i18n editing." }, { "date": "2023-01-17T10:02:00.000Z", "version": "v1.0.0", + "type": "major", "description": "The first major release of Static CMS with an all-new UI, revamped documentation and much more." } ] diff --git a/packages/docs/src/interface.ts b/packages/docs/src/interface.ts index a00f5b1e..d2b14785 100644 --- a/packages/docs/src/interface.ts +++ b/packages/docs/src/interface.ts @@ -66,7 +66,8 @@ export interface HomepageData { export interface Release { readonly date: string; readonly version: string; - readonly description: string; + readonly type: 'major' | 'minor' | 'patch'; + readonly description?: string; } export interface DocsData { diff --git a/packages/docs/src/pages/index.tsx b/packages/docs/src/pages/index.tsx index 93fc67cf..c9ef2206 100644 --- a/packages/docs/src/pages/index.tsx +++ b/packages/docs/src/pages/index.tsx @@ -3,10 +3,11 @@ import Card from '@mui/material/Card'; import CardActionArea from '@mui/material/CardActionArea'; import CardContent from '@mui/material/CardContent'; import Chip from '@mui/material/Chip'; -import { styled, useTheme } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; +import { styled, useTheme } from '@mui/material/styles'; import Image from 'next/image'; import Link from 'next/link'; +import { useMemo } from 'react'; import DateDisplay from '../components/DateDisplay'; import Container from '../components/layout/Container'; @@ -250,6 +251,8 @@ const StyledFeatureText = styled('div')` const Home = ({ docsGroups, searchablePages }: DocsMenuProps) => { const theme = useTheme(); + const majorMinorThemes = useMemo(() => releases.filter(r => r.type !== 'patch'), []); + return ( @@ -325,11 +328,11 @@ const Home = ({ docsGroups, searchablePages }: DocsMenuProps) => { {[...Array(3)].map((_, index) => { - if (index >= releases.length) { + if (index >= majorMinorThemes.length) { return null; } - const release = releases[index]; + const release = majorMinorThemes[index]; return ( { A complete release history for Static CMS is available on GitHub.

- Changelogs for recent major releases can also be found below. + Changelogs for all releases can also be found below.
@@ -126,25 +129,25 @@ const Releases = ({ docsGroups, searchablePages }: DocsMenuProps) => { {release.version} - - - -
  • - - Changelog - -
  • +    + + {format(parseISO(release.date), 'MMM dd, yyyy')}
    + + {isNotEmpty(release.description) ? release.description : null} + + Changelog + +
    ))}