From a0d7b52ccb049b372113e817bddf100219f9fb0b Mon Sep 17 00:00:00 2001 From: Lio Date: Tue, 23 Jul 2024 19:31:15 +0200 Subject: [PATCH] move most options to database --- src/components/Image.astro | 1 - src/components/IndexSidebar.astro | 46 +++++++++++++++++-------------- src/components/Sidebar.astro | 17 ++++++++++-- src/layouts/CharacterList.astro | 26 ++++++++++++++--- src/layouts/Gallery.astro | 29 ++++++++++++++++--- src/layouts/Index.astro | 6 +++- src/pages/characters/[slug].astro | 18 ------------ src/pages/characters/index.astro | 2 +- 8 files changed, 93 insertions(+), 52 deletions(-) diff --git a/src/components/Image.astro b/src/components/Image.astro index a36a4ef..b95e997 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -1,5 +1,4 @@ --- -import { Picture as AstroPic } from "astro:assets"; const { src, alt, nsfw } = Astro.props; --- diff --git a/src/components/IndexSidebar.astro b/src/components/IndexSidebar.astro index a15e21e..cb84869 100644 --- a/src/components/IndexSidebar.astro +++ b/src/components/IndexSidebar.astro @@ -1,40 +1,44 @@ --- import { Image } from "astro:assets"; -import config from "../../config.yaml"; import Social from "./Social.astro"; -const {} = Astro.props; +import pb from "../lib/pb"; + +const avatarRec = await pb + .collection("images") + .getFirstListItem("useAsAvatar=true"); + +const icon = await pb.files.getUrl(avatarRec, avatarRec.file); +const socials = await pb.collection("socials").getFullList(); + +const config = { + icon, + socials, + title: import.meta.env.PUBLIC_TITLE, + description: import.meta.env.PUBLIC_DESCRIPTION, +}; ---