-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.old.js
89 lines (81 loc) · 2.44 KB
/
index.js.old.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import React from "react"
import Layout from "../components/Layout"
import SEO from "../components/SEO"
import { GatsbyImage } from "gatsby-plugin-image"
import { Link, graphql, useStaticQuery } from "gatsby"
const IndexPage = () => {
const data = useStaticQuery(graphql`
query {
allMarkdownRemark(
filter: { frontmatter: { featured: { eq: true } } }
sort: { order: DESC, fields: [frontmatter___date] }
) {
edges {
node {
excerpt
frontmatter {
title
subtitle
date(formatString: "LL")
author
excerpt
featured
postimage {
alt
src {
absolutePath
childImageSharp {
gatsbyImageData(
layout: FULL_WIDTH
placeholder: BLURRED
formats: [AUTO, WEBP, AVIF]
)
}
}
}
}
fields {
slug
}
}
}
}
}
`)
return (
<Layout>
<SEO title="Welcome!" />
<section>
<h1>Welcome</h1>
<p>I am a technologist. I see in systems and patterns. My blog focus is coding, architecture, integration, automation, robotics, artificial intelligence & languages.</p>
</section>
<section>
<h1>Posts</h1>
<div className="flexbox">
{data.allMarkdownRemark.edges.map((edge, i) => {
const postImage = edge.node.frontmatter.postimage
return (
<div key={edge.node.fields.slug + i.toString()} className="post">
<Link to={edge.node.fields.slug}>
{
postImage && (
<GatsbyImage
image={postImage.src.childImageSharp.gatsbyImageData}
alt={postImage.alt}
layout="fullWidth"
/>
)
}
<h3>{edge.node.frontmatter.title}</h3>
<div className="postedInfo">posted on {edge.node.frontmatter.date}</div>
<div className="postExcerpt"><p>{edge.node.frontmatter.excerpt}</p></div>
</Link>
</div>
)
})}
</div>
</section>
</Layout>
)
}
export default IndexPage