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 (
|
return (
|
||||||
<StyledMetaContainer>
|
<StyledMetaContainer>
|
||||||
{/* posts count */}
|
{/* posts count */}
|
||||||
|
{props.fetchedPage.length > 0 && (
|
||||||
|
<>
|
||||||
<FontAwesomeIcon icon={faFile} />
|
<FontAwesomeIcon icon={faFile} />
|
||||||
|
|
||||||
{props.fetchedPage.length
|
{props.fetchedPage.length} post
|
||||||
? props.fetchedPage.length + " posts"
|
{props.fetchedPage.length > 1 && "s"}
|
||||||
: "no posts"}
|
</>
|
||||||
|
)}
|
||||||
{/* date */}
|
{/* date */}
|
||||||
<FontAwesomeIcon icon={faCalendar} />
|
<FontAwesomeIcon icon={faCalendar} />
|
||||||
|
|
||||||
|
@ -44,7 +46,9 @@ const Meta = (props: { fetchedPage: PageData }) => {
|
||||||
<FontAwesomeIcon icon={faBook} />
|
<FontAwesomeIcon icon={faBook} />
|
||||||
|
|
||||||
{props.fetchedPage.wordCount
|
{props.fetchedPage.wordCount
|
||||||
? props.fetchedPage.wordCount + " words"
|
? props.fetchedPage.wordCount +
|
||||||
|
" word" +
|
||||||
|
(props.fetchedPage.wordCount > 1 && "s")
|
||||||
: "unknown words"}
|
: "unknown words"}
|
||||||
</StyledMetaContainer>
|
</StyledMetaContainer>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue