Skip to content

Commit

Permalink
fix: initial news-post date & adjust slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidosmf committed Jan 29, 2024
1 parent 906c213 commit 74a101f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Lottie as a standard with Lottie Animation Community (LAC) format specification body
date: "2024-01-24T12:01:01.284Z"
date: "2024-01-31T12:01:01.284Z"
description: "Announcing Lottie Animation Community"
featuredImage: lac.png
---
Expand Down
2 changes: 1 addition & 1 deletion content/templates/implementations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Implementations
date: "2024-01-24T12:01:01.284Z"
date: "2024-01-4T12:01:05.284Z"
description: "A curated list of awesome things related to Lottie"
image: null
---
Expand Down
14 changes: 9 additions & 5 deletions src/components/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Footer = () => {
}
}
}
allMarkdownRemark(sort: { frontmatter: { date: DESC } }) {
allMarkdownRemark(filter: { fields: { contentType: { eq: "news" } } }) {
nodes {
fields {
slug
Expand All @@ -35,9 +35,9 @@ export const Footer = () => {

const newsRoutePrefix = `/${ROUTES.news.route}`
const newsRoute =
(allMarkdownRemark.nodes || []).length === 0
? newsRoutePrefix
: allMarkdownRemark.nodes[0].fields?.slug
(allMarkdownRemark.nodes || []).length === 1
? allMarkdownRemark.nodes[0].fields?.slug
: newsRoutePrefix
const { siteMetadata } = site
const { urls, author } = siteMetadata

Expand Down Expand Up @@ -69,7 +69,11 @@ export const Footer = () => {
</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link as={Link} className="text-capitalize" to={newsRoute || ''}>
<Nav.Link
as={Link}
className="text-capitalize"
to={newsRoute || ""}
>
{ROUTES.news.text}
</Nav.Link>
</Nav.Item>
Expand Down
8 changes: 4 additions & 4 deletions src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Header = () => {
}
}
}
allMarkdownRemark(sort: { frontmatter: { date: DESC } }) {
allMarkdownRemark(filter: { fields: { contentType: { eq: "news" } } }) {
nodes {
fields {
slug
Expand All @@ -32,9 +32,9 @@ export const Header = () => {

const newsRoutePrefix = `/${ROUTES.news.route}`
const newsRoute =
(allMarkdownRemark.nodes || []).length === 0
? newsRoutePrefix
: allMarkdownRemark.nodes[0].fields?.slug
(allMarkdownRemark.nodes || []).length === 1
? allMarkdownRemark.nodes[0].fields?.slug
: newsRoutePrefix
const { siteMetadata } = site
const { urls } = siteMetadata

Expand Down

0 comments on commit 74a101f

Please sign in to comment.