Skip to content

Commit c4842ad

Browse files
sort blog posts list in reverse chronological order
1 parent bbc88d9 commit c4842ad

File tree

14 files changed

+21
-3
lines changed

14 files changed

+21
-3
lines changed

src/components/blog-posts-list/blog-posts-list.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import styles from "./blog-posts-list.module.css";
33

44
export default class BlogPostsList extends HTMLElement {
55
async connectedCallback() {
6-
const posts = (await getContentByRoute("/blog")).filter((page) => page.label !== "Blog");
6+
const posts = (await getContentByRoute("/blog"))
7+
.filter((page) => page.data.published)
8+
// we sort in reverse chronologic order, e.g. last in, first out (LIFO)
9+
.sort((a, b) =>
10+
new Date(a.data.published).getTime() > new Date(b.data.published).getTime() ? -1 : 1,
11+
);
712

813
this.innerHTML = `
914
<ul class="${styles.postsList}">

src/pages/blog/release/v0-15-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.15.0 Release
33
abstract: Introducing our newest feature, Theme Packs. It&apo;s like CSS Zen Garden but as a plugin.
4+
published: 2021-08-06
45
layout: blog
56
---
67

src/pages/blog/release/v0-18-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.18.0 Release
33
abstract: Let&apos;s review the latest enhancements now available in Greenwood.
4+
published: 2021-10-22
45
layout: blog
56
---
67

src/pages/blog/release/v0-19-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.19.0 Release
33
abstract: This release includes a new scaffolding tool for starting your next Greenwood project.
4+
published: 2021-11-11
45
layout: blog
56
---
67

src/pages/blog/release/v0-20-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.20.0 Release
33
abstract: We&apos;ve migrated to ESM! Let&apos;s discuss our journey there.
4+
published: 2021-12-18
45
coverImage: /assets/blog/nodejs.png
56
layout: blog
67
---

src/pages/blog/release/v0-21-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.21.0 Release
33
abstract: External data sources are now supported in Greenwood and template support to our new project scaffolding CLI.
4+
published: 2022-01-08
45
layout: blog
56
---
67

src/pages/blog/release/v0-23-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.23.0 Release
33
abstract: Server-Side Rendering is now available in Greenwood, so let&apos;s talk all about it.
4+
published: 2022-02-11
45
layout: blog
56
---
67

src/pages/blog/release/v0-24-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.24.0 Release
33
abstract: This release brings some exciting new features for optimizing the local development experience with Greenwood.
4+
published: 2022-03-06
45
layout: blog
56
---
67

src/pages/blog/release/v0-26-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.26.0 Release
33
abstract: As a follow up to our SSR release, in this release we are excited to share our progress and introduce to use WCC!
4+
published: 2022-07-26
45
layout: blog
56
---
67

src/pages/blog/release/v0-27-0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: v0.27.0 Release
33
abstract: This release introduces the concept of full-stack Web Components to Greenwood. Let us share with you what mean.
4+
published: 2022-11-23
45
layout: blog
56
---
67

0 commit comments

Comments
 (0)