js
(attr, resText, { xssDefend, elText }) => {
const res = JSON.parse(resText).result.data;
return {
title: xssDefend(res.site.siteMetadata.title),
subtitle: "",
updated: xssDefend(res.allMarkdownRemark.edges[0].node.frontmatter.date),
entryList: res.allMarkdownRemark.edges.map((entry) => {
const date = new Date(entry.node.frontmatter.date)
date.setDate(date.getDate() - 1)
return {
title: xssDefend(entry.node.frontmatter.title),
published: xssDefend(entry.node.frontmatter.date),
summary: xssDefend(entry.node.excerpt),
link: xssDefend('https://lyn.one/' + date.toISOString().split('T')[0].replace(/-/g, '/') + entry.node.fields.slug),
};
}),
};
};