thumbnail stuff

This commit is contained in:
Graham Hall
2022-12-09 09:59:22 -05:00
parent 28be6d311b
commit 18287083b9
5 changed files with 17 additions and 4 deletions
+1 -4
View File
@@ -2,10 +2,7 @@
--- ---
<footer> <footer>
<p> <p style={{ fontSize: "0.8rem" }}>
Copyright 2022 - <a href="https://ghall.dev">Graham Hall</a>
</p>
<p>
Built with <a href="https://astro.build">Astro</a> and <a Built with <a href="https://astro.build">Astro</a> and <a
href="https://picocss.com">Pico.css</a href="https://picocss.com">Pico.css</a
> >
+1
View File
@@ -1,5 +1,6 @@
--- ---
import "@picocss/pico"; import "@picocss/pico";
import "../styles/global.css";
import Header from "../components/Header.astro"; import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro"; import Footer from "../components/Footer.astro";
+5
View File
@@ -20,6 +20,11 @@ const posts = await response.json();
{ {
posts.objects.map((post) => ( posts.objects.map((post) => (
<article> <article>
{post.thumbnail ? (
<div style={{ marginBottom: "25px" }}>
<img src={post.thumbnail} alt={`Thumbnail for ${post.title}`} />
</div>
) : null}
<div> <div>
<div style={{ display: "flex", justifyContent: "space-between" }}> <div style={{ display: "flex", justifyContent: "space-between" }}>
<h4>{post.title}</h4> <h4>{post.title}</h4>
+7
View File
@@ -20,6 +20,13 @@ const post = posts.objects[0];
<Layout title={post.title}> <Layout title={post.title}>
<article> <article>
{
post.thumbnail ? (
<div style={{ marginBottom: "25px" }}>
<img src={post.thumbnail} alt={`Thumbnail for ${post.title}`} />
</div>
) : null
}
<div style={{ display: "flex", justifyContent: "space-between" }}> <div style={{ display: "flex", justifyContent: "space-between" }}>
<h4>{post.title}</h4> <h4>{post.title}</h4>
<h5>{`🗓️ ${format(new Date(post.published_at), "MMM do, y")}`}</h5> <h5>{`🗓️ ${format(new Date(post.published_at), "MMM do, y")}`}</h5>
+3
View File
@@ -0,0 +1,3 @@
img {
border-radius: 5px;
}