diff --git a/src/markdoc/layouts/Post.svelte b/src/markdoc/layouts/Post.svelte index 87cb47397b..f891372119 100644 --- a/src/markdoc/layouts/Post.svelte +++ b/src/markdoc/layouts/Post.svelte @@ -19,6 +19,7 @@ export let timeToRead: string; export let cover: string; export let category: string; + export let lastUpdated: string; const authors = getContext('authors'); const authorData = authors.find((a) => a.slug === author); @@ -231,6 +232,15 @@ {/if}
+ {#if lastUpdated} + + Updated: + + + {/if} +
@@ -315,4 +325,8 @@ font-size: 24px; } } + + .last-updated-text { + color: var(--primary, #e4e4e7); + } diff --git a/src/routes/blog/+page.ts b/src/routes/blog/+page.ts index 3540570407..e8b5667745 100644 --- a/src/routes/blog/+page.ts +++ b/src/routes/blog/+page.ts @@ -23,6 +23,7 @@ export function load() { description: frontmatter.description, featured: frontmatter?.featured ?? false, date: new Date(frontmatter.date), + lastUpdated: new Date(frontmatter.lastUpdated), cover: frontmatter.cover, timeToRead: frontmatter.timeToRead, author: frontmatter.author, diff --git a/src/routes/blog/content.ts b/src/routes/blog/content.ts index daa1f6d70e..e8fa3e0be4 100644 --- a/src/routes/blog/content.ts +++ b/src/routes/blog/content.ts @@ -20,6 +20,7 @@ export type PostsData = { title: string; description: string; date: Date; + lastUpdated: Date; cover: string; timeToRead: number; author: string; @@ -51,6 +52,7 @@ export const posts = Object.entries(postsGlob) title: frontmatter.title, description: frontmatter.description, date: new Date(frontmatter.date), + lastUpdated: new Date(frontmatter.lastUpdated), cover: frontmatter.cover, timeToRead: frontmatter.timeToRead, author: frontmatter.author, diff --git a/src/routes/blog/post/announcing-init-faster-smoother-better/+page.markdoc b/src/routes/blog/post/announcing-init-faster-smoother-better/+page.markdoc index 2d67277aad..a8ba6daf7a 100644 --- a/src/routes/blog/post/announcing-init-faster-smoother-better/+page.markdoc +++ b/src/routes/blog/post/announcing-init-faster-smoother-better/+page.markdoc @@ -3,6 +3,7 @@ layout: post title: "Announcing: A new Init. Faster. Smoother. Better." description: Init is about to begin, and we’re bringing you many new features and products to be excited about. Experience everything new with Appwrite during the week of August 19 to 23. date: 2024-08-07 +lastUpdated: 2024-08-10 cover: /images/blog/announcing-init-faster-smoother-better/init-cover.png timeToRead: 4 author: eldad-fux