1
1
Fork 0

Index sort by updatedAt

This commit is contained in:
Joe Wroten 2019-01-26 13:58:38 -06:00
parent 03698bf7e3
commit e1537095c4
6 changed files with 7 additions and 1 deletions

View file

@ -9,10 +9,11 @@ const initialize = async () => {
}
const generateIndexPage = async jsonData => {
let sortedData = jsonData.sort((prev, cur) => new Date(prev.updatedAt) < new Date(cur.updatedAt));
const indexTemplate = await getTemplate('index');
try {
return outputFile(join(distPath, 'index') + '.html', indexTemplate(jsonData));
return outputFile(join(distPath, 'index') + '.html', indexTemplate(sortedData));
} catch (error) {
console.error('Error while writing index html file', error);
return;

View file

@ -1,6 +1,7 @@
{
"name": "Code2College",
"description": "Curriculum development and interview prep.",
"updatedAt": "2018-12-10T00:00:00Z",
"pageType": "volunteer",
"repositoryTopics": {
"edges": [

View file

@ -1,6 +1,7 @@
{
"name": "Innovating in FinX",
"description": "Stronger communities w/ better financial tools.",
"updatedAt": "2019-01-30T00:00:00Z",
"pageType": "work-history",
"repositoryTopics": {
"edges": [

View file

@ -1,6 +1,7 @@
{
"name": "Austin Give Camp",
"description": "Pro-bono web dev for good.",
"updatedAt": "2016-10-04",
"pageType": "volunteer",
"repositoryTopics": {
"edges": [

View file

@ -1,6 +1,7 @@
{
"name": "Patient Education",
"description": "Empowering doctors to educate through tech.",
"updatedAt": "2015-12-30T00:00:00Z",
"pageType": "work-history",
"repositoryTopics": {
"edges": [

View file

@ -6,6 +6,7 @@ module.exports = `{
name
description
url
updatedAt
repositoryTopics(last: 5) {
edges {
node {