From ec2297b5db7ada673320e15396f61e6dbe07e10b Mon Sep 17 00:00:00 2001 From: YouHaveTrouble Date: Sat, 12 Apr 2025 18:00:52 +0200 Subject: [PATCH] move project showcase to the main page --- src/components/Nav.astro | 1 - src/components/ProjectsFeature.astro | 131 +++++++++++++++++++++++++++ src/pages/about.astro | 2 +- src/pages/index.astro | 3 + src/pages/projects.astro | 2 +- src/styles/global.css | 2 + 6 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 src/components/ProjectsFeature.astro diff --git a/src/components/Nav.astro b/src/components/Nav.astro index 759e21b..0ff1a13 100644 --- a/src/components/Nav.astro +++ b/src/components/Nav.astro @@ -76,7 +76,6 @@ const { current = '' } = Astro.props; diff --git a/src/components/ProjectsFeature.astro b/src/components/ProjectsFeature.astro new file mode 100644 index 0000000..9278e4b --- /dev/null +++ b/src/components/ProjectsFeature.astro @@ -0,0 +1,131 @@ +--- +import {getCollection} from "astro:content"; + +const projects = await getCollection('projects'); +projects.sort((a, b) => a.data.name.localeCompare(b.data.name)); +--- +
+

Projects

+

+ Here are some of the projects I'm working on. Most of them are open source, so feel free to check them out! +
+ Projects presented here are what I consider in presentable and/or finished state. They might or might not get + updates. +
+ Most logos generated using DALL-E mini. +

+
+ { + projects.map((project, index) => { + return ( +
+
+ 4 ? "lazy" : "eager"} + decoding="async" + draggable="false" + /> +
+
+

{project.data.name}

+ {project.data.description} +
+ +
+ ) + }) + } +
+ +
+ + diff --git a/src/pages/about.astro b/src/pages/about.astro index be28405..2d5f64a 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -3,7 +3,7 @@ import BaseLayout from '../layouts/BaseLayout.astro'; const title = 'About'; const description = 'A few words about myself.'; -const permalink = `${Astro.site.href}about`; +const permalink = `${Astro?.site?.href}about`; --- diff --git a/src/pages/index.astro b/src/pages/index.astro index d0d6797..ea3d21d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -3,6 +3,7 @@ import BaseLayout from '../layouts/BaseLayout.astro'; import ActivityWidget from "../components/ActivityWidget.astro"; import ViewCounter from "../components/ViewCounter.astro"; import SocialsWidget from "../components/SocialsWidget.astro"; +import ProjectsFeature from "../components/ProjectsFeature.astro"; const title = 'Home'; const description = 'My little corner of the internet.'; @@ -22,6 +23,7 @@ const permalink = Astro?.site?.href ?? '/'; + @@ -32,6 +34,7 @@ const permalink = Astro?.site?.href ?? '/'; flex-direction: column; justify-content: center; margin: 2em 0; + gap: 2rem; .home-copy { flex: 1; diff --git a/src/pages/projects.astro b/src/pages/projects.astro index 9dd1a07..3e9123d 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -4,7 +4,7 @@ import {getCollection} from "astro:content"; const title = 'Projects'; const description = 'Stuff I\'m working on.'; -const permalink = `${Astro.site.href}projects`; +const permalink = `${Astro?.site?.href}projects`; const projectsCollection = await getCollection('projects'); projectsCollection.sort((a, b) => a.data.name.localeCompare(b.data.name)); diff --git a/src/styles/global.css b/src/styles/global.css index 3d791f3..66f6ff4 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -25,6 +25,7 @@ p { html { overflow-y: auto; scrollbar-gutter: stable; + scrollbar-color: var(--primary-color) transparent; } } @@ -52,6 +53,7 @@ h6 { font-family: var(--font-family-sans); font-weight: 700; line-height: 1.2; + margin: 0; } h1 {