INNER CODE UNIT · JavaScript
posts
jamstack-cms/jamstack-cms · src/pages/index.js:32
let posts = this.props.data.appsync.itemsByContentType.items.filter(post => post.published)
posts = posts.reverse()
let authorImages = checkNodeData(this.props.data.allAuthorImages)
if (authorImages) {
authorImages = this.props.data.allAuthorImages.edges[0].node.data
}
const { theme, siteDescription } = this.props.context
return (
<SiteContainer {...this.props}>
<SEO title="All posts" />
<div css={mainContainer}>
<h1 css={heading(theme)}>Welcome to the full stack CMS built for the modern age.</h1>
<div css={authorInfoStyle(theme, authorImages)}>
{
authorImages && authorImages.map((image, index) => (
<img key={index} alt="Author" src={image} css={authorImageStyle(theme)} />
))
}