fix: remove duplicate dates on articles

This commit is contained in:
Troy 2025-04-10 10:48:00 +01:00
parent 78b0780e12
commit 8eb41f8fa4
Signed by: troy
GPG key ID: DFC06C02ED3B4711
28 changed files with 230 additions and 38 deletions

View file

@ -9,11 +9,6 @@ import RelatedArticles from "@components/RelatedArticles.astro";
const { article, isPost = false } = Astro.props;
const { Content } = await article.render();
let datesMatch = false;
if (article.data.date.getTime() == article.data.updated?.getTime()) {
datesMatch = true;
}
const listFormatter = new Intl.ListFormat("en-GB", {
style: "long",
type: "conjunction",
@ -41,7 +36,7 @@ const listFormatter = new Intl.ListFormat("en-GB", {
<div class="flex items-center gap-2">
<Icon name="mdi:calendar" />
{
datesMatch ? (
!article.data.updated ? (
<p title="Date">
<FormattedDate date={article.data.date} />
</p>