diff --git a/src/pages/archive.js b/src/pages/archive.js index 9a3b58c..00c71b3 100644 --- a/src/pages/archive.js +++ b/src/pages/archive.js @@ -11,10 +11,13 @@ export default function Archive({ data }) { }); const yearGroupsHtml = yearGroups.map(yg => { + yg.edges.sort(function(a,b) { + return new Date(b.node.frontmatter.date) - new Date(a.node.frontmatter.date); + }); const postListItems = yg.edges.map(({node}) => { return (
  • - {node.frontmatter.date} - {node.frontmatter.title} + {node.frontmatter.shortDate} - {node.frontmatter.title}
  • ); }); @@ -48,7 +51,8 @@ export const query = graphql` } frontmatter { title - date(formatString: "MMM Do") + date + shortDate: date(formatString: "MM/DD") } } }