From f3918a460cec83a52601b23ad7060194c2f8a4fb Mon Sep 17 00:00:00 2001 From: Max Richter Date: Sat, 25 Oct 2025 17:02:05 +0200 Subject: [PATCH] feat: some shit --- .github/workflows/default.yaml | 17 +++-------------- Dockerfile | 2 +- src/components/Image.astro | 2 +- src/components/resources/Review.astro | 18 +++++++++++++++--- .../[resourceType]/[resourceName].astro | 12 +++++++++++- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index a7f1542..a29dd99 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -18,22 +18,14 @@ jobs: steps: - name: 🔄 Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + lfs: true - name: 🔢 Prepare cache keys run: | - # Calculate cache IDs for Git LFS - git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - LFS_CACHE_ID=$(cat .lfs-assets-id | md5sum)-v1 - echo "LFS_CACHE_ID=$LFS_CACHE_ID" >> $GITHUB_ENV echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV - - name: 🗄️ Cache Git LFS objects - uses: actions/cache@v4 - with: - path: .git/lfs - key: ${{ runner.os }}-lfs-${{ env.LFS_CACHE_ID }} - - name: 🛠️ Cache PNPM dependencies uses: actions/cache@v4 with: @@ -50,9 +42,6 @@ jobs: restore-keys: | ${{ runner.os }}-astro- - - name: 🔄 Pull Git LFS files - run: git lfs pull - - name: 🏗️ Build site run: | pnpm i && pnpm build diff --git a/Dockerfile b/Dockerfile index 7ba267b..2c533ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:21-alpine +FROM node:25-alpine # Install necessary packages RUN apk add --no-cache \ diff --git a/src/components/Image.astro b/src/components/Image.astro index bf6c21f..06de6a1 100644 --- a/src/components/Image.astro +++ b/src/components/Image.astro @@ -85,7 +85,7 @@ const sizes = thumbnail pictureAttributes={{ class: `${hash ? "block h-full relative" : ""} ${loader ? "thumb" : ""} ${pictureClass}`, }} - class={Astro.props.class} + class={`${Astro.props.class} h-full w-full`} widths={sizes.map((size) => size.width)} sizes={sizes .map((size) => `${size.media || "100vw"} ${size.width}px`) diff --git a/src/components/resources/Review.astro b/src/components/resources/Review.astro index 94d065f..3a2586a 100644 --- a/src/components/resources/Review.astro +++ b/src/components/resources/Review.astro @@ -5,6 +5,13 @@ import Image from "@components/Image.astro"; import type { ImageMetadata } from "astro"; const { resource } = Astro.props; + +function formatRating(rating: string | number) { + if (typeof rating === "number") { + return "⭐".repeat(rating); + } + return rating; +} ---
@@ -21,8 +28,13 @@ const { resource } = Astro.props; /> ) } -

{resource?.content?.itemReviewed?.name || "Unknown Name"}

- { resource?.content?.reviewRating?.ratingValue !== undefined &&
{resource?.content?.reviewRating?.ratingValue}
} +

+ {resource?.content?.itemReviewed?.name || "Unknown Name"} +

+ { + resource?.content?.reviewRating?.ratingValue !== undefined && ( +
{formatRating(resource?.content?.reviewRating?.ratingValue)}
+ ) + }
-
diff --git a/src/pages/resources/[resourceType]/[resourceName].astro b/src/pages/resources/[resourceType]/[resourceName].astro index c879923..e109fd8 100644 --- a/src/pages/resources/[resourceType]/[resourceName].astro +++ b/src/pages/resources/[resourceType]/[resourceName].astro @@ -14,6 +14,7 @@ export async function getStaticPaths() { const paths = await Promise.all( resourceTypes.map(async (resourceType) => { const resources = await memorium.listResource(resourceType.id); + console.log({resources:resources?.content[0]}) return resources?.content?.map((res: any) => { return { params: { @@ -43,7 +44,16 @@ const resource = await memorium.listResource( href={path("/resources/" + resourceType)}> back - {resource?.content?.url && link} +
{ resource?.content.datePublished?.toLocaleString("en-US", {