This commit is contained in:
17
.github/workflows/default.yaml
vendored
17
.github/workflows/default.yaml
vendored
@@ -18,22 +18,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: 🔄 Checkout code
|
- name: 🔄 Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: true
|
||||||
|
|
||||||
- name: 🔢 Prepare cache keys
|
- name: 🔢 Prepare cache keys
|
||||||
run: |
|
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
|
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
|
- name: 🛠️ Cache PNPM dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -50,9 +42,6 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-astro-
|
${{ runner.os }}-astro-
|
||||||
|
|
||||||
- name: 🔄 Pull Git LFS files
|
|
||||||
run: git lfs pull
|
|
||||||
|
|
||||||
- name: 🏗️ Build site
|
- name: 🏗️ Build site
|
||||||
run: |
|
run: |
|
||||||
pnpm i && pnpm build
|
pnpm i && pnpm build
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:21-alpine
|
FROM node:25-alpine
|
||||||
|
|
||||||
# Install necessary packages
|
# Install necessary packages
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const sizes = thumbnail
|
|||||||
pictureAttributes={{
|
pictureAttributes={{
|
||||||
class: `${hash ? "block h-full relative" : ""} ${loader ? "thumb" : ""} ${pictureClass}`,
|
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)}
|
widths={sizes.map((size) => size.width)}
|
||||||
sizes={sizes
|
sizes={sizes
|
||||||
.map((size) => `${size.media || "100vw"} ${size.width}px`)
|
.map((size) => `${size.media || "100vw"} ${size.width}px`)
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ import Image from "@components/Image.astro";
|
|||||||
import type { ImageMetadata } from "astro";
|
import type { ImageMetadata } from "astro";
|
||||||
|
|
||||||
const { resource } = Astro.props;
|
const { resource } = Astro.props;
|
||||||
|
|
||||||
|
function formatRating(rating: string | number) {
|
||||||
|
if (typeof rating === "number") {
|
||||||
|
return "⭐".repeat(rating);
|
||||||
|
}
|
||||||
|
return rating;
|
||||||
|
}
|
||||||
---
|
---
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -21,8 +28,13 @@ const { resource } = Astro.props;
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<h1 class="text-4xl mb-4">{resource?.content?.itemReviewed?.name || "Unknown Name"}</h1>
|
<h1 class="text-4xl mb-4">
|
||||||
{ resource?.content?.reviewRating?.ratingValue !== undefined && <div>{resource?.content?.reviewRating?.ratingValue}</div>}
|
{resource?.content?.itemReviewed?.name || "Unknown Name"}
|
||||||
|
</h1>
|
||||||
|
{
|
||||||
|
resource?.content?.reviewRating?.ratingValue !== undefined && (
|
||||||
|
<div>{formatRating(resource?.content?.reviewRating?.ratingValue)}</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
<div set:html={markdownToHtml(resource?.content?.reviewBody)} />
|
<div set:html={markdownToHtml(resource?.content?.reviewBody)} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export async function getStaticPaths() {
|
|||||||
const paths = await Promise.all(
|
const paths = await Promise.all(
|
||||||
resourceTypes.map(async (resourceType) => {
|
resourceTypes.map(async (resourceType) => {
|
||||||
const resources = await memorium.listResource(resourceType.id);
|
const resources = await memorium.listResource(resourceType.id);
|
||||||
|
console.log({resources:resources?.content[0]})
|
||||||
return resources?.content?.map((res: any) => {
|
return resources?.content?.map((res: any) => {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
@@ -43,7 +44,16 @@ const resource = await memorium.listResource(
|
|||||||
href={path("/resources/" + resourceType)}>
|
href={path("/resources/" + resourceType)}>
|
||||||
<span class="i-tabler-arrow-left"></span> back
|
<span class="i-tabler-arrow-left"></span> back
|
||||||
</a>
|
</a>
|
||||||
{resource?.content?.url && <a class="flex gap-1 items-center"href={resource?.content?.url}>link<span class="inline-block w-3 h-3 i-tabler-external-link"/></a>}
|
<div class="links">
|
||||||
|
{
|
||||||
|
resource?.content?.url && (
|
||||||
|
<a class="flex gap-1 items-center" href={resource?.content?.url}>
|
||||||
|
link
|
||||||
|
<span class="inline-block w-3 h-3 i-tabler-external-link" />
|
||||||
|
</a>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
<div class="date opacity-50">
|
<div class="date opacity-50">
|
||||||
{
|
{
|
||||||
resource?.content.datePublished?.toLocaleString("en-US", {
|
resource?.content.datePublished?.toLocaleString("en-US", {
|
||||||
|
|||||||
Reference in New Issue
Block a user