File tree 5 files changed +11
-2
lines changed
5 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ module.exports = {
9
9
resolve : `gatsby-source-filesystem` ,
10
10
options : {
11
11
name : `src` ,
12
- path : `${ __dirname } /src/` ,
12
+ path : `${ __dirname } /src/content ` ,
13
13
} ,
14
14
} ,
15
15
{
Original file line number Diff line number Diff line change 1
1
---
2
2
title : Pandas and Bananas
3
3
date : " 2017-08-21"
4
+ publish : false
4
5
---
5
6
6
7
Do Pandas eat bananas? Check out this short video that shows that yes! pandas do
Original file line number Diff line number Diff line change 1
1
---
2
2
title : " Sweet Pandas Eating Sweets"
3
3
date : " 2017-08-10"
4
+ publish : true
4
5
---
5
6
6
7
Pandas are really sweet.
Original file line number Diff line number Diff line change @@ -35,14 +35,18 @@ export default ({ data }) => {
35
35
36
36
export const query = graphql `
37
37
query IndexQuery {
38
- allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC }) {
38
+ allMarkdownRemark(
39
+ sort: { fields: [frontmatter___date], order: DESC }
40
+ filter: { frontmatter: { publish: { eq: true } } }
41
+ ) {
39
42
totalCount
40
43
edges {
41
44
node {
42
45
id
43
46
frontmatter {
44
47
title
45
48
date(formatString: "DD MMMM, YYYY")
49
+ publish
46
50
}
47
51
fields {
48
52
slug
Original file line number Diff line number Diff line change @@ -2,9 +2,11 @@ import React from "react";
2
2
3
3
export default ( { data } ) => {
4
4
const post = data . markdownRemark ;
5
+ console . log ( post ) ;
5
6
return (
6
7
< div >
7
8
< h1 > { post . frontmatter . title } </ h1 >
9
+ < h3 > Published: { post . frontmatter . publish } </ h3 >
8
10
< div dangerouslySetInnerHTML = { { __html : post . html } } />
9
11
</ div >
10
12
) ;
@@ -16,6 +18,7 @@ export const query = graphql`
16
18
html
17
19
frontmatter {
18
20
title
21
+ publish
19
22
}
20
23
}
21
24
}
You can’t perform that action at this time.
0 commit comments