meta value updates
- prevent posts count from showing in non-series-home pages - add an "s" only when there are multiple values
This commit is contained in:
parent
79059267bd
commit
6bc48a6905
1 changed files with 11 additions and 7 deletions
|
@ -22,12 +22,14 @@ const Meta = (props: { fetchedPage: PageData }) => {
|
|||
return (
|
||||
<StyledMetaContainer>
|
||||
{/* posts count */}
|
||||
{props.fetchedPage.length > 0 && (
|
||||
<>
|
||||
<FontAwesomeIcon icon={faFile} />
|
||||
|
||||
{props.fetchedPage.length
|
||||
? props.fetchedPage.length + " posts"
|
||||
: "no posts"}
|
||||
|
||||
{props.fetchedPage.length} post
|
||||
{props.fetchedPage.length > 1 && "s"}
|
||||
</>
|
||||
)}
|
||||
{/* date */}
|
||||
<FontAwesomeIcon icon={faCalendar} />
|
||||
|
||||
|
@ -44,7 +46,9 @@ const Meta = (props: { fetchedPage: PageData }) => {
|
|||
<FontAwesomeIcon icon={faBook} />
|
||||
|
||||
{props.fetchedPage.wordCount
|
||||
? props.fetchedPage.wordCount + " words"
|
||||
? props.fetchedPage.wordCount +
|
||||
" word" +
|
||||
(props.fetchedPage.wordCount > 1 && "s")
|
||||
: "unknown words"}
|
||||
</StyledMetaContainer>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue