From 4d4d3e70b65f071212ffbc4b187deebe6e8e070a Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 25 Sep 2023 10:00:05 +0200 Subject: [PATCH] refactor: move links to index --- src/layouts/Layout.astro | 29 +++-------------------------- src/pages/index.astro | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b4f387d..66ab894 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -6,34 +6,11 @@ import type { Link } from "../components/Nav.astro"; export interface Props { title?: string; description?: string; + links?: Link[]; } -const { title, description } = Astro.props; -const links: Link[] = [ - { - url: "https://ayos.blog", - icon: "blog", - }, - { - url: "https://ayco.io/@ayo", - icon: "mastodon", - text: "social" - }, - { - url: "https://ayco.io/gh/", - icon: "github", - }, - // { - // url: "https://codepen.io/ayoayco-the-styleful", - // icon: "codepen", - // text: "pens" - // }, - { - url: "https://www.npmjs.com/~aayco", - icon: "npm", - set: "gg" - } -]; +const { links = [], title, description } = Astro.props; + --- diff --git a/src/pages/index.astro b/src/pages/index.astro index 61909d8..2814d5e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,6 +2,7 @@ import Layout from "../layouts/Layout.astro"; import Card from "../components/Card.astro"; import Footer from "../components/Footer.astro"; +import type { Link } from "../components/Nav.astro"; const response = await fetch('https://social.ayco.io/api/v1/accounts/109547735999980313') let { @@ -13,9 +14,34 @@ let { const [first_name, last_name] = display_name.split(' ') note = note.replace('ayco.io/gh/', '').replace('ayco.io/sh/', '') +const links: Link[] = [ + { + url: "https://ayos.blog", + icon: "blog", + }, + { + url: "https://ayco.io/@ayo", + icon: "mastodon", + text: "social" + }, + { + url: "https://ayco.io/gh/", + icon: "github", + }, + // { + // url: "https://codepen.io/ayoayco-the-styleful", + // icon: "codepen", + // text: "pens" + // }, + { + url: "https://www.npmjs.com/~aayco", + icon: "npm", + set: "gg" + } +]; --- - +