Add author credits to end of post
This commit is contained in:
parent
f8408cbcc3
commit
f4955f77c1
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { graphql } from 'gatsby'
|
||||
import { Link } from 'gatsby'
|
||||
import Helmet from 'react-helmet'
|
||||
|
||||
import { Layout } from '../components/common'
|
||||
|
@ -40,6 +41,15 @@ const Post = ({ data, location }) => {
|
|||
className="content-body load-external-scripts"
|
||||
dangerouslySetInnerHTML={{ __html: post.html }}
|
||||
/>
|
||||
<section className="content-footer">
|
||||
<p>
|
||||
Written by { post.authors.map((author, key) => ([
|
||||
<Link to={`/author/${author.slug}`}>{ author.name }</Link>,
|
||||
<span>{ key == post.authors.length-1 ? '' :
|
||||
key == post.authors.length-2 ? ' and ' : ', ' }</span>
|
||||
]))}
|
||||
</p>
|
||||
</section>
|
||||
</section>
|
||||
</article>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue