Skip to content

Commit

Permalink
Merge pull request #43 from gusma/v2
Browse files Browse the repository at this point in the history
Fix dates component
  • Loading branch information
gusma authored Oct 5, 2023
2 parents f93889c + 0273de7 commit b5a0fe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { CollectionEntry } from 'astro:content';
import BaseHead from '../components/BaseHead.astro';
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import FormattedDate from '../components/FormattedDate.astro';
type Props = CollectionEntry<'blog'>['data'];
Expand Down Expand Up @@ -73,10 +72,10 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
<div class="prose">
<div class="title">
<div class="date">
<FormattedDate date="{pubDate}" />
{pubDate}
{ updatedDate && (
<div class="last-updated-on">
Last updated on <FormattedDate date="{updatedDate}" />
Last updated on {updatedDate}
</div>
) }
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Footer from '../components/Footer.astro';
import MainProfile from '../components/MainProfile.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
import { getCollection } from 'astro:content';
import FormattedDate from '../components/FormattedDate.astro';
const posts = (await getCollection('blog')).sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
Expand Down Expand Up @@ -100,7 +99,7 @@ const posts = (await getCollection('blog')).sort(
<img width={720} height={360} src={post.data.heroImage} alt="" />
<h4 class="title top-padding">{post.data.title}</h4>
<p class="date">
<FormattedDate date={post.data.pubDate} />
{post.data.pubDate}
</p>
</a>
<div class="top-padding">
Expand Down

0 comments on commit b5a0fe1

Please sign in to comment.