import React from "react"; import Layout from "../components/Layout"; import { graphql } from "gatsby"; import { AllGhostPostDescription } from "../models/all-post-description.model"; import { PaginationContext } from "../models/pagination.model"; import PostCard from "../components/PostCard"; import Pagination from "../components/Pagination"; import { AuthorDescription } from "../models/author-description.model"; import userAvatar from "../images/female_avatar.svg"; import classNames from "classnames"; import url from "url"; type AuthorTemplateProps = { data: { allGhostPost: AllGhostPostDescription; ghostAuthor: AuthorDescription; }; location: any; pageContext?: PaginationContext; }; const AuthorTemplate: React.FC = ({ data, location, pageContext, }) => { const { allGhostPost, ghostAuthor } = data; return (

{ghostAuthor.name}

{/* Regional Manager */} {ghostAuthor.bio && (

)}
{allGhostPost.edges.map(({ node }, i) => { return ; })}
); }; export default AuthorTemplate; export const pageQuery = graphql` query GhostAuthorQuery($slug: String!, $limit: Int!, $skip: Int!) { ghostAuthor(slug: { eq: $slug }) { ...GhostAuthorDetails } allGhostPost( sort: { order: DESC, fields: [published_at] } filter: { authors: { elemMatch: { slug: { eq: $slug } } } } limit: $limit skip: $skip ) { edges { ...AllGhostPostsDescription } } } `;