initial Previously index page

This commit is contained in:
Ayo 2023-04-30 12:17:16 +02:00
parent 49580b3fb3
commit 98c27fc5c4
5 changed files with 76 additions and 10 deletions

View file

@ -1,11 +1,12 @@
--- ---
export interface Props { export interface Props {
url: string; url: string;
text?: string;
} }
const { url } = Astro.props; const { text = "Back", url } = Astro.props;
--- ---
<nav><a class="back-link" href={url}>&larr; Back</a></nav> <nav><a class="back-link" href={url}>&larr; {text}</a></nav>
<style> <style>
nav { nav {

View file

@ -3,21 +3,21 @@ import type { AstroInstance } from "astro";
export interface Props { export interface Props {
posts: AstroInstance[]; posts: AstroInstance[];
title: string; title?: string;
} }
const { title, posts } = Astro.props; const { title, posts } = Astro.props;
const postUrls: string[] = posts.map((post) => post.url || ""); const postUrls: string[] = posts.map((post) => post.url || "");
--- ---
<h2>{title}</h2> {title ? <h2>{title}</h2> : ""}
<ul> <ul>
{ {
postUrls postUrls
.filter((url) => url !== "") .filter((url) => url !== "")
.map((url) => ( .map((url) => (
<li> <li>
<a href={url} title={url?.replace("/now/and-then/", "")}> <a href={url} title={url?.replace("/now/and-then/posts/", "")}>
{url?.replace("/now/and-then/", "")} {url?.replace("/now/and-then/posts/", "")}
</a> </a>
</li> </li>
)) ))

View file

@ -0,0 +1,65 @@
---
import Layout from "../../../layouts/Layout.astro";
import Footer from "../../../components/Footer.astro";
import Back from "../../../components/Back.astro";
import Posts from "../../../components/Posts.astro";
const posts = await Astro.glob("./posts/*.astro");
const title = "Previously...";
---
<Layout title={title} description="What Ayo Ayco have been up to?">
<main>
<Back text="Home" url="/" />
<h1><span class="text-gradient">{title}</span></h1>
<em>What have I been up to?</em>
<Posts posts={posts} />
<Footer />
</main>
</Layout>
<style>
h1 {
margin: 2rem 0;
}
main {
margin: auto;
padding: 1em;
max-width: var(--content-width);
}
.text-gradient {
font-weight: 900;
background-image: var(--ayo-gradient);
animation: pulse 4s ease-in-out infinite;
background-size: 500% 500%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 100% 200%;
background-position-y: 100%;
border-radius: 0.4rem;
}
.highlighted-content {
line-height: 1.6;
margin: 1rem 0;
background: #4f39fa;
padding: 1rem;
border-radius: 0.4rem;
color: var(--color-bg);
}
.highlighted-content code {
font-size: 0.875em;
border: 0.1em solid var(--color-border);
border-radius: 4px;
padding: 0.15em 0.25em;
}
.link-card-grid {
display: grid;
gap: 1rem;
padding: 0;
}
</style>

View file

@ -1,7 +1,7 @@
--- ---
import Layout from "../../../layouts/Layout.astro"; import Layout from "../../../../layouts/Layout.astro";
import Footer from "../../../components/Footer.astro"; import Footer from "../../../../components/Footer.astro";
import Back from "../../../components/Back.astro"; import Back from "../../../../components/Back.astro";
const title = "Settling in The Netherlands"; const title = "Settling in The Netherlands";
const description = const description =
"This year (2022) I have moved to The Netherlands with my family; specifically to the northern area of Amsterdam."; "This year (2022) I have moved to The Netherlands with my family; specifically to the northern area of Amsterdam.";

View file

@ -4,7 +4,7 @@ import Footer from "../../components/Footer.astro";
import Back from "../../components/Back.astro"; import Back from "../../components/Back.astro";
import Posts from "../../components/Posts.astro"; import Posts from "../../components/Posts.astro";
const posts = await Astro.glob("./and-then/*.astro"); const posts = await Astro.glob("./and-then/posts/*.astro");
--- ---
<Layout title="Now" description="What is Ayo Ayco currently up to?"> <Layout title="Now" description="What is Ayo Ayco currently up to?">