Skip to content

Commit

Permalink
improvement(post): post page only read from contents whose type is 'p…
Browse files Browse the repository at this point in the history
…ost'
  • Loading branch information
mdluo committed Dec 9, 2019
1 parent 3619537 commit b9ec8d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import Layout from '../components/Layout';
const Index: React.FC = () => {
const data = useStaticQuery<GetPostsQuery>(graphql`
query GetPosts {
allMarkdownRemark(sort: { order: DESC, fields: frontmatter___date }) {
allMarkdownRemark(
sort: { order: DESC, fields: frontmatter___date }
filter: { frontmatter: { type: { eq: "post" } } }
) {
edges {
node {
frontmatter {
Expand Down

0 comments on commit b9ec8d1

Please sign in to comment.