generated from brckd/astro-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
85 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,54 @@ | ||
--- | ||
import Layout from "@layouts/Layout.astro"; | ||
import { SITE_DESCRIPTION } from "@src/consts"; | ||
import { getCollection } from "astro:content"; | ||
const posts = (await getCollection("blog")).sort( | ||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf(), | ||
); | ||
const formatDate = (date: Date) => | ||
date.toLocaleString("en-GB", { | ||
dateStyle: "medium", | ||
timeStyle: "short", | ||
}); | ||
--- | ||
|
||
<Layout title="blog"> | ||
<ul> | ||
<div class="article-list"> | ||
{ | ||
posts.map((post) => ( | ||
<li> | ||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a> | ||
</li> | ||
<article> | ||
<a href={`/blog/${post.slug}/`}> | ||
<h2>{post.data.title}</h2> | ||
</a> | ||
{post.data.description} | ||
<footer> | ||
published {formatDate(post.data.pubDate)} | ||
{post.data.updatedDate && | ||
`, last updated ${formatDate(post.data.updatedDate)}`} | ||
</footer> | ||
</article> | ||
)) | ||
} | ||
</ul> | ||
</div> | ||
</Layout> | ||
|
||
<style> | ||
h2 { | ||
margin: 0; | ||
} | ||
.article-list { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-gap); | ||
} | ||
article { | ||
border: rgb(var(--color-highlight)) var(--size-border-width) solid; | ||
padding: var(--spacing-padding); | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-gap); | ||
} | ||
footer { | ||
font-size: 0.8em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
--- | ||
import Layout from "@layouts/BlogPost.astro"; | ||
import Layout from "@layouts/Layout.astro"; | ||
const mail = "[email protected]".replaceAll("x", ""); | ||
--- | ||
|
||
<Layout | ||
title="socials" | ||
description="a list of my socials." | ||
pubDate={new Date("Aug 29 2023")} | ||
> | ||
<Layout title="socials" description="a list of my socials."> | ||
<p> | ||
I'm all around the internet! This is a list of platforms I'm most active on. | ||
</p> | ||
|
@@ -68,5 +64,7 @@ const mail = "[email protected]".replaceAll("x", ""); | |
border-collapse: separate; | ||
border-spacing: 1ch 0; | ||
padding: 0; | ||
border: rgb(var(--color-highlight)) var(--size-border-width) solid; | ||
padding: var(--spacing-padding); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters