forked from kentcdodds/old-kentcdodds.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwriting-blog.js
54 lines (52 loc) · 1.4 KB
/
writing-blog.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
import React from 'react'
import {graphql, StaticQuery} from 'gatsby'
import Blog from 'components/blog'
import {TinyLetterSubscribe} from 'components/forms/subscribe'
function WritingBlog(props) {
return <Blog {...props} subscribeForm={<TinyLetterSubscribe />} />
}
export default function WritingBlogWithData(props) {
return (
<StaticQuery
query={graphql`
query {
allMdx(
sort: {fields: [frontmatter___date], order: DESC}
filter: {
frontmatter: {published: {ne: false}, unlisted: {ne: true}}
fileAbsolutePath: {regex: "//content/writing-blog//"}
}
) {
edges {
node {
excerpt(pruneLength: 300)
id
fields {
title
isWriting
slug
date
}
parent {
... on File {
sourceInstanceName
}
}
frontmatter {
title
date(formatString: "MMMM DD, YYYY")
banner {
...bannerImage640
}
slug
keywords
}
}
}
}
}
`}
render={data => <WritingBlog data={data} {...props} />}
/>
)
}