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:
parent
2293fa0530
commit
8c3221a0df
3 changed files with 3 additions and 3 deletions
|
@ -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 NASA’s Perseverance Rover.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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());
|
||||
---
|
||||
|
|
Loading…
Reference in a new issue