Portfolio example fix (#1457)

* Fix project page in portfolio example

Projects list was blank because template filter uses publishDate but
front matter uses published_at. Changed front matter to publishDate.

* Fix nested projects in portfolio example
This commit is contained in:
Peter Cook 2021-09-29 21:13:02 +01:00 committed by GitHub
parent 2293fa0530
commit 8c3221a0df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@
layout: ../../layouts/project.astro
title: Mars Rover
client: Self
published_at: 2020-03-02 00:00:00
publishDate: 2020-03-02 00:00:00
img: https://images.unsplash.com/photo-1547234935-80c7145ec969?fit=crop&w=1400&h=700&q=75
description: |
We built an unofficial Mars Rover Landing site in celebration of NASAs Perseverance Rover.

View file

@ -2,7 +2,7 @@
layout: ../../../layouts/project.astro
title: Lunar Eclipse
client: Self
published_at: 2020-03-04 00:00:00
publishDate: 2020-03-04 00:00:00
img: https://images.unsplash.com/photo-1548391350-1a529f6ea42d?fit=crop&w=1400&h=700&q=75
description: |
We took some cool pictures of the moon and made a website about it.

View file

@ -8,7 +8,7 @@ interface MarkdownFrontmatter {
publishDate: number;
}
const projects = Astro.fetchContent<MarkdownFrontmatter>('./project/*.md')
const projects = Astro.fetchContent<MarkdownFrontmatter>('./project/**/*.md')
.filter(({ publishDate }) => !!publishDate)
.sort((a, b) => new Date(b.publishDate).valueOf() - new Date(a.publishDate).valueOf());
---