From cde632001e40e54e7a760be1dc7c92be6b99be96 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Tue, 7 Jun 2022 15:36:21 -0500 Subject: [PATCH] Add SimpleList for categories page --- src/components/simple-list.astro | 27 +++++++++++++++++++++++++ src/pages/categories.astro | 34 +++++++++++--------------------- 2 files changed, 38 insertions(+), 23 deletions(-) create mode 100644 src/components/simple-list.astro diff --git a/src/components/simple-list.astro b/src/components/simple-list.astro new file mode 100644 index 0000000..8ef6dd1 --- /dev/null +++ b/src/components/simple-list.astro @@ -0,0 +1,27 @@ +--- +// Simple list for listing thinngs like categories, tags, etc. + +const { + items +} = Astro.props +--- + diff --git a/src/pages/categories.astro b/src/pages/categories.astro index bff9fbb..006ce36 100644 --- a/src/pages/categories.astro +++ b/src/pages/categories.astro @@ -10,10 +10,17 @@ import { DoesItAPI } from '~/helpers/api/client.js' import Layout from '../layouts/default.astro' +import SimpleList from '../components/simple-list.astro' const kindIndex = await DoesItAPI.kind.index.get() -const kinds = Object.values( kindIndex ) +const kinds = Object.values( kindIndex ).map( category => { + return { + href: `/kind/${ category.kindName }`, + heading: category.label, + description: category.description, + } +}) --- - - - +