+
+
diff --git a/examples/social-feed/src/content/config.ts b/examples/social-feed/src/content/config.ts
index 2bed482e2..7bbf268df 100644
--- a/examples/social-feed/src/content/config.ts
+++ b/examples/social-feed/src/content/config.ts
@@ -1,26 +1,22 @@
-// import { rssSchema } from '@astrojs/rss';
+import { rssSchema } from '@astrojs/rss';
import { defineCollection, z } from 'astro:content';
const posts = defineCollection({
- // TODO: Extend rssSchema here — was doing that in my standalone project but seems to be broken in the monorepo.
- schema: z
- .object({ title: z.string(), description: z.string().optional(), pubDate: z.date() })
+ schema: ({ image }) => rssSchema
.extend({
- tags: z.array(z.string()).default([]),
- cover: z
- .object({
- src: z.string(),
- // TODO: Support experimental assets instead of plain string schema:
- // image().refine(
- // (img) => img.width >= 885,
- // 'Cover image must be at least 885px wide.'
- // )
- alt: z.string(),
- })
- .optional(),
- type: z.enum(['article', 'tweet']).default('tweet'),
- })
- .strict(),
+ tags: z.array(z.string()).default([]),
+ cover: z
+ .object({
+ src: image().refine(
+ (img) => img.width >= 885,
+ 'Cover image must be at least 885px wide.'
+ ),
+ alt: z.string(),
+ })
+ .optional(),
+ type: z.enum(['article', 'note']).default('note'),
+ })
+ .strict(),
});
export const collections = { posts };
diff --git a/examples/social-feed/src/content/posts/first-post.md b/examples/social-feed/src/content/posts/first-post.md
index 74e3b4f03..19db8a463 100644
--- a/examples/social-feed/src/content/posts/first-post.md
+++ b/examples/social-feed/src/content/posts/first-post.md
@@ -3,8 +3,26 @@ title: First post on my new site!
pubDate: 2023-01-01
tags: [keyboards, thoughts]
cover:
- src: stock-1.jpg
+ src: ../../assets/stock-1.jpg
alt: A laptop with a code editor open
---
-Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+Dignissim eu sagittis aliquet magna sagittis. Eu etiam faucibus quis non. Laoreet amet aliquam enim sapien. Cras ac enim nulla morbi ultrices elementum metus neque nulla. Quis mi consectetur donec tempor habitant.
+
+Id at orci nulla nunc. Habitant a amet turpis facilisi purus cursus dui imperdiet. Integer fermentum amet nunc tristique scelerisque feugiat pellentesque phasellus. Feugiat euismod id varius id mattis ac ut. Donec aliquet fusce ut egestas vehicula sagittis.
+
+Mauris vulputate tristique porttitor sed integer felis. In eget sodales lobortis laoreet molestie aliquet est aliquet tortor. Sodales erat rhoncus tellus mattis etiam nunc ornare. Nisi ut tellus elementum gravida dictum diam porta. Nulla porttitor magna duis pretium egestas nisl ornare.
+
+## Heading One
+
+Suscipit id porttitor laoreet purus semper fermentum libero cras magna. Non hendrerit lectus tincidunt condimentum. Sollicitudin pretium at vel nibh tempus proin faucibus donec sed. Habitant et risus auctor platea viverra tellus. Faucibus dapibus neque enim metus porttitor pulvinar pharetra amet sem. Nibh a facilisis pellentesque ut pellentesque. Amet semper ultrices est lacus facilisis pulvinar viverra. Quis velit cursus viverra varius vestibulum. Ultricies interdum id dapibus nunc bibendum vitae varius in. Lorem vel congue in amet et pellentesque sed facilisis. Id amet sed suspendisse tincidunt lacinia sit. Ut libero id ornare cursus porttitor elementum.
+
+## Heading Number Two
+
+Sagittis fames arcu tempor morbi sed mauris eu blandit cras. Risus amet nec auctor nunc pretium commodo. Dictum duis nascetur est molestie ullamcorper sit tempor. Vestibulum dictumst magna cursus aenean vitae ornare amet non.
+
+Dui tortor viverra eu montes. Elit pretium pharetra aliquam pellentesque congue id morbi maecenas. Donec a egestas ipsum sit a ipsum. Quis vestibulum feugiat tincidunt justo tellus turpis. Luctus dignissim porta dictumst ut auctor neque in.
+
+![Close-up of a mechanical keyboard with LED backlighting](../../assets/mechanical-keyboard.png)
+
+Pellentesque faucibus faucibus magna tempus proin amet in viverra. Eros non ipsum justo pellentesque vestibulum morbi proin euismod. Sagittis in amet at aliquet facilisis.
diff --git a/examples/social-feed/src/content/posts/third-post.md b/examples/social-feed/src/content/posts/third-post.md
index ed924287c..44f20052d 100644
--- a/examples/social-feed/src/content/posts/third-post.md
+++ b/examples/social-feed/src/content/posts/third-post.md
@@ -2,7 +2,7 @@
title: Three is a magic number
pubDate: 2023-01-03
cover:
- src: stock-2.jpg
+ src: ../../assets/stock-2.jpg
alt: A backlit multicolored mechanical keyboard
---
diff --git a/examples/social-feed/src/layouts/Article.astro b/examples/social-feed/src/layouts/Article.astro
new file mode 100644
index 000000000..6cd295327
--- /dev/null
+++ b/examples/social-feed/src/layouts/Article.astro
@@ -0,0 +1,173 @@
+---
+import { Image } from 'astro:assets';
+import type { CollectionEntry } from 'astro:content';
+import getReadingTime from 'reading-time';
+import Layout, { type Props as LayoutProps } from './Base.astro';
+import FormattedDate from '../components/FormattedDate.astro';
+import TagList from '../components/TagList.astro';
+import Icon from '../components/Icon.astro';
+
+export interface Props extends LayoutProps {
+ article: CollectionEntry<'posts'>;
+ next?: CollectionEntry<'posts'>;
+ prev?: CollectionEntry<'posts'>;
+}
+
+const { article, next, prev } = Astro.props;
+
+const { Content, headings } = await article.render();
+
+const readingTime = getReadingTime(article.body).text;
+---
+
+
+
+
+
+ Back to feed
+
+ {article.data.cover && }
+