52
loading...
This website collects cookies to deliver better user experience
Our go-to content solutions:@NetlifyCMS for internal projects (when we just need it to work)@forestryio for client projects (when a clean, user friendly UI is a must)@fauna (when a file based CMS just won't cut it)
What tools are you always reaching for?
/images
to /uploads
. In our case, that meant updating /src/pages/about.astro
and each blog post in /src/pages/posts
./src/data/authors.json
file which is a basic JSON object/map of the two demo authors. This structure doesn't make as much sense for a file-based CMS./src/data/authors
directory. Later we can point Forestry to that folder, define the property types available for each author, and allow CMS users to create new authors without touching JSON./uploads
directory instead of /images
.import authorData from "../data/authors.json";
let allAuthors = Astro.fetchContent("../data/authors/*.md");
let authorData = allAuthors.reduce((acc, next) => {
return {
...acc,
[`src/data/authors/${next.slug}.md`]: next,
};
}, {});
src/data/authors/${next.slug}.md
code? We'll be setting up Forestry soon, but one thing to note now is how Forestry handles content relationships by default.authorData
above, we're mapping from each author's filepath to the author's data. There are other ways you could manage the data here, but for the demo this is easier since you won't need to update the pages templates otherwise.