#Suitable CMS for a Plant Database website

26 messages · Page 1 of 1 (latest)

bronze obsidian
#

I want to create a plant database for local plants in my area where I each plant is an object that has fields uses, location, recipes and so on. I want to use Astro for this as there seems to be a good fit for this but I'm still lost on how I should store and manage my data, The site will be statically rendered as it's just a database after all and I don't plan on adding any sign-in or comments functionality etc.

So yeah, I'm essentially looking for a way to manage and store my plant documents/objects.

As for features, pagination and search are all that's needed and I'm thinking that I could do both of those with Astro while the site still remains SSG.

Any help is greatly appreciated and sorry if this isn't structured well. Also thanks for reading.

meager nova
bronze obsidian
bronze obsidian
meager nova
#

I think that one is the best choise for your needs houston_fingerguns

shadow canyon
bronze obsidian
shadow canyon
#

But some of the CMS options, like Keystatic, allow you to edit your Content Collections in a UI friendly way, instead of editing markdown files. If that's of value to you.

bronze obsidian
#

isn't it possible to do it in json as well?

shadow canyon
#

Yes... so UI friendly way to edit json or markdown.
If you didn't already know, when you define your collection, set type="data".

bronze obsidian
#

I'm checking out keystatic atm

#

Yeah i'm not sure what to do now tbh, tiny bit lost

#

I was thinking of creating in my src/content/plants/ this json file:

{
  name: "green tea tree",
  leafShape:"oval",
  uses: [ "tea","skin care", "etc"]
  img: "/green-tea"
}```
#

And add the image to public or wherever is best

#

and repeat for others

#

And that would allow me to render a static site on cf/gh pages

#

What you're saying is Keystatic would work as a UI for that?

shadow canyon
#

Yes, instead of editing the json directly, you could use Keystatic. Usually a better option if you have non-tech people editing the data, as json is easy to mess up. If you're doing it yourself, then you may not see the benefit.

For images, I would not recommend putting them in public/, because you will not get Astro's built-in image optimizations. You can either put them in src/assets (or other folder inside src/)

{
  name: "green tea tree",
  leafShape:"oval",
  uses: [ "tea","skin care", "etc"]
  img: "../../assets/green-tea.jpg"
}
src/content/plants/green-tea.json

or you can co-locate them with your content:

{
  name: "green tea tree",
  leafShape:"oval",
  uses: [ "tea","skin care", "etc"]
  img: "green-tea.jpg"
}
src/content/plants/green-tea/index.json
src/content/plants/green-tea/green-tea.jpg
bronze obsidian
#

Ok i'll work on getting keystatic setup

#

I'm still not certain how to render out pages for the json data as my test files failed to build so far

#
[...slug].astro
---
import { getCollection } from 'astro:content';
// 1. Generate a new path for every collection entry
export async function getStaticPaths() {
  const plantsEntries = await getCollection('plants');
  return plantsEntries.map(entry => ({
    params: { slug: entry.data.id }, props: { entry },
  }));
}
// 2. For your template, you can get the entry directly from the prop
const { entry } = Astro.props;
const { Content } = await entry.render();
---
<h1>entry.data.name</h1>
<Content />```
shadow canyon
#

You won't have any content to render (only with markdown)

bronze obsidian
#

My entry.render is an issue

#

Ahh