From 74a101fedb5cee4ebf161e415ddea31de297bee4 Mon Sep 17 00:00:00 2001 From: Aidos Sabit Date: Mon, 29 Jan 2024 12:47:27 +0600 Subject: [PATCH] fix: initial news-post date & adjust slugs --- .../announcing-lottie-animation-community/index.md | 2 +- content/templates/implementations.md | 2 +- src/components/footer.js | 14 +++++++++----- src/components/header.js | 8 ++++---- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/content/news/announcing-lottie-animation-community/index.md b/content/news/announcing-lottie-animation-community/index.md index 7bc05f9..4c7eb52 100644 --- a/content/news/announcing-lottie-animation-community/index.md +++ b/content/news/announcing-lottie-animation-community/index.md @@ -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 --- diff --git a/content/templates/implementations.md b/content/templates/implementations.md index 82c165e..49e5c71 100644 --- a/content/templates/implementations.md +++ b/content/templates/implementations.md @@ -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 --- diff --git a/src/components/footer.js b/src/components/footer.js index 3f48e01..22832c3 100644 --- a/src/components/footer.js +++ b/src/components/footer.js @@ -22,7 +22,7 @@ export const Footer = () => { } } } - allMarkdownRemark(sort: { frontmatter: { date: DESC } }) { + allMarkdownRemark(filter: { fields: { contentType: { eq: "news" } } }) { nodes { fields { slug @@ -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 @@ -69,7 +69,11 @@ export const Footer = () => { - + {ROUTES.news.text} diff --git a/src/components/header.js b/src/components/header.js index 7f85ce4..fa6e02d 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -19,7 +19,7 @@ export const Header = () => { } } } - allMarkdownRemark(sort: { frontmatter: { date: DESC } }) { + allMarkdownRemark(filter: { fields: { contentType: { eq: "news" } } }) { nodes { fields { slug @@ -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