Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template> <Layout :show-logo="false"> <!-- Author intro --> <Author :show-title="true" /> <!-- List posts --> <div class="posts"> <PostCard v-for="post in $page.posts.edges" :key="post.node.id" /> <!-- :post="edge.node" --> <Pager :info="$page.posts.pageInfo"/> </div> </Layout> </template> // <page-query> // query Posts ($page: Int) { // posts: allPost (perPage: 2, page: $page, filter: { published: { eq: true }}) @paginate { // totalCount // pageInfo { // totalPages // currentPage // isFirst // isLast // } // edges { // node { // id // title // date (format: "D. MMMM YYYY") // timeToRead // description // cover_image (width: 770, height: 380, blur: 10) // path // tags { // id // title // path // } // } // } // } // </page-query> <page-query> query Posts ($page: Int) { posts: allPost (perPage: 2, page: $page) @paginate { totalCount pageInfo { totalPages currentPage isFirst isLast } edges { node { title path } } } } </page-query> <script> import { Pager } from 'gridsome' import Author from '~/components/Author.vue' import PostCard from '~/components/PostCard.vue' export default { components: { Author, PostCard, Pager }, metaInfo: { title: 'Hello, world!' } }; </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement