- Introduction
-
+
+
Astro 5 introduces the Content Layer API, a powerful way to fetch content from any source,
including local files, remote APIs, and CMSs. In this article, we'll explore how to set
up a robust system for articles and projects.
-
+
-
- "The best way to manage content is to not manage it at all." — Someone, probably.
-
+
+ The best way to manage content is to not manage it at all.
+ Someone, probably
+
-
- Let's look at some code. Our new content.config.ts uses the{' '}
- glob loader to pull in MDX files from outside the src directory:
-
+
+ Let's look at some code. Our new content.config.ts uses the{' '}
+ glob loader to pull in MDX files from outside the src directory:
+
-
- {`// services/www/src/content.config.ts
+
+
+ {`// services/www/src/content.config.ts
import { defineCollection, z } from 'astro:content';
import { glob } from 'astro/loaders';
@@ -63,37 +67,39 @@ const articles = defineCollection({
}),
});
-export const collections = { articles };`}
-
+export const collections = { articles };`}
+
+
- Why Astro 5?
-
+
+
Astro's zero-JS by default approach is perfect for content-heavy sites. By moving our
- content outside of the src directory, we keep our project clean and organized.
-
+ content outside of the src directory, we keep our project clean and organized.
+
-
- -
- Better performance: Only what you need is shipped.
-
- -
- Improved developer experience: Fast HMR and great tooling.
-
- -
- Type safety: Zod schemas validate your frontmatter.
-
-
+
+
+ Better performance: Only what you need is shipped.
+
+
+ Improved developer experience: Fast HMR and great tooling.
+
+
+ Type safety: Zod schemas validate your frontmatter.
+
+
- Visual Media
-
+
+
We can also include images and videos. The layout ensures they are responsive and fit the
grid.
-
-
- Placeholder for Image/Video
-
+
+
+ Placeholder for Image/Video
+
- Conclusion: It's a great time to be a web developer.
+ Conclusion: It's a great time to be a web developer.
),
};
+
diff --git a/services/www/src/layouts/ArticleLayout/ArticleLayout.tsx b/services/www/src/layouts/ArticleLayout/ArticleLayout.tsx
index dc4ab35..f283d92 100644
--- a/services/www/src/layouts/ArticleLayout/ArticleLayout.tsx
+++ b/services/www/src/layouts/ArticleLayout/ArticleLayout.tsx
@@ -1,5 +1,5 @@
import { cn } from '@ermnvldmr/stl';
-import { VStack, HStack, Markdown } from '@ermnvldmr/ui';
+import { VStack, HStack, Markdown, Container, Time, Header, Paragraph, Text } from '@ermnvldmr/ui';
import React from 'react';
/**
@@ -56,51 +56,49 @@ export const ArticleLayout: React.FC