Skip to content

Commit

Permalink
Update styles
Browse files Browse the repository at this point in the history
  • Loading branch information
derekmbrown committed Feb 1, 2025
1 parent 6756dc8 commit e26f972
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"astro-emoji": "^1.2.0",
"astro-icon": "^1.1.5",
"astro-seo": "^0.8.4",
"moment": "^2.30.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"remark-code-titles": "^0.1.2",
Expand Down
4 changes: 3 additions & 1 deletion src/components/ui/NoteItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import moment from 'moment'

export default function NoteItem({ note }) {
const title = note.data.title
const pubDate = new Date(note.data.pubDate).toDateString().slice(4, 15)
const pubDate = moment(note.data.pubDate).format('MMM D YYYY')

return (
<a href={`/notes/${note.id}`}>
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/Note.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
import Main from './Main.astro'
import moment from 'moment'
const { frontmatter } = Astro.props
const { title, pubDate, tags, dek, url } = frontmatter
const publishedDate = moment(pubDate).format('MMMM D YYYY')
tags.sort()
---
Expand Down Expand Up @@ -42,9 +44,7 @@ tags.sort()
<span class="text-5xl mb-4 font-bold">{title}</span>
<div class="flex flex-wrap">
<span class="text-[#7E8C9A] text-lg">
Published: {new Date(pubDate).toLocaleString(
'default', { month: 'long', day: '2-digit', year: 'numeric' }
).replace(',', '')}
Published: {publishedDate}
</span>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ allNotes.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
</div>

{allNotes.slice(0, 5).map((note) =>
<NoteItem client:load note={note} />
<NoteItem note={note} />
)}
</Main>
2 changes: 1 addition & 1 deletion src/pages/tags/[tag].astro
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ const title = `Tag: ${tag}`
>
<div class="mb-6 text-xl">{filteredNotes.length} notes tagged with <span class="font-bold">{tag}</span>:</div>
{filteredNotes.map((note) =>
<NoteItem client:load note={note} />
<NoteItem note={note} />
)}
</Main>
2 changes: 1 addition & 1 deletion src/pages/tags/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tags.sort()
>
<div class="flex flex-wrap gap-y-3">
{tags.map(tag => (
<TagItem client:load tag={tag} />
<TagItem tag={tag} />
))}
</div>
</Main>

0 comments on commit e26f972

Please sign in to comment.