chore: pnpm up
This commit is contained in:
24
package.json
24
package.json
@ -11,32 +11,32 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/check": "^0.9.4",
|
"@astrojs/check": "^0.9.4",
|
||||||
"@astrojs/mdx": "^4.3.0",
|
"@astrojs/mdx": "^4.3.1",
|
||||||
"@astrojs/svelte": "^7.1.0",
|
"@astrojs/svelte": "^7.1.0",
|
||||||
"@astrojs/tailwind": "^6.0.2",
|
"@astrojs/tailwind": "^6.0.2",
|
||||||
"astro": "^5.9.1",
|
"astro": "^5.12.0",
|
||||||
"astro-i18n-aut": "^0.7.3",
|
"astro-i18n-aut": "^0.7.3",
|
||||||
"exifreader": "^4.30.1",
|
"exifreader": "^4.31.1",
|
||||||
"svelte": "^5.28.6",
|
"svelte": "^5.36.10",
|
||||||
"svelte-gestures": "^5.1.4",
|
"svelte-gestures": "^5.1.4",
|
||||||
"tailwindcss": "^4.1.6",
|
"tailwindcss": "^4.1.11",
|
||||||
"thumbhash": "^0.1.1",
|
"thumbhash": "^0.1.1",
|
||||||
"typescript": "^5.8.3"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/sitemap": "^3.4.1",
|
"@astrojs/sitemap": "^3.4.1",
|
||||||
"@iconify-json/tabler": "^1.2.17",
|
"@iconify-json/tabler": "^1.2.19",
|
||||||
"@types/markdown-it": "^14.1.2",
|
"@types/markdown-it": "^14.1.2",
|
||||||
"@unocss/preset-icons": "^66.1.1",
|
"@unocss/preset-icons": "^66.3.3",
|
||||||
"@unocss/reset": "^66.1.1",
|
"@unocss/reset": "^66.3.3",
|
||||||
"astro-font": "^1.1.0",
|
"astro-font": "^1.1.0",
|
||||||
"markdown-it": "^14.1.0",
|
"markdown-it": "^14.1.0",
|
||||||
"ogl": "^1.0.11",
|
"ogl": "^1.0.11",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.6.2",
|
||||||
"prettier-plugin-astro": "^0.14.1",
|
"prettier-plugin-astro": "^0.14.1",
|
||||||
"sharp": "^0.34.1",
|
"sharp": "^0.34.3",
|
||||||
"unocss": "^66.1.1",
|
"unocss": "^66.3.3",
|
||||||
"unplugin-icons": "^22.1.0",
|
"unplugin-icons": "^22.1.0",
|
||||||
"vite-plugin-glsl": "^1.4.1"
|
"vite-plugin-glsl": "^1.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1773
pnpm-lock.yaml
generated
1773
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -53,10 +53,15 @@ const allowedExif = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export async function getExifData(image: ImageMetadata) {
|
export async function getExifData(image: ImageMetadata) {
|
||||||
|
if (image.format === "svg") return undefined; // SVGs don't have EXIF data")
|
||||||
const sharp = await getSharp();
|
const sharp = await getSharp();
|
||||||
if (!sharp) return;
|
if (!sharp) return;
|
||||||
|
const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath;
|
||||||
try {
|
try {
|
||||||
const tags = await ExifReader.load((image as ImageMetadata & { fsPath: string }).fsPath, { async: true });
|
|
||||||
|
const buffer = await sharp(imagePath).toBuffer();
|
||||||
|
|
||||||
|
const tags = await ExifReader.load(buffer, { async: true });
|
||||||
|
|
||||||
const out: Record<string, any> = {};
|
const out: Record<string, any> = {};
|
||||||
let hasExif = false;
|
let hasExif = false;
|
||||||
@ -70,7 +75,7 @@ export async function getExifData(image: ImageMetadata) {
|
|||||||
return hasExif ? out : undefined;
|
return hasExif ? out : undefined;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
console.log("Error reading EXIF data", error);
|
console.log(`Error reading EXIF data from ${imagePath}`, error);
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
src/helpers/memorium.ts
Normal file
10
src/helpers/memorium.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
export async function listResource(id: string): Promise<any[]> {
|
||||||
|
try {
|
||||||
|
const response = await fetch(
|
||||||
|
`http://localhost:8080/resources?name=${id}`,
|
||||||
|
);
|
||||||
|
return await response.json();
|
||||||
|
} catch (error) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const response = await fetch(
|
const movieReviews = await memorium.listResource("Media/movies/*");
|
||||||
"http://localhost:8080/resources?name=Media/movies/*",
|
|
||||||
);
|
|
||||||
const movieReviews = await response.json();
|
|
||||||
|
|
||||||
const paths = movieReviews.map((review: any) => {
|
const paths = movieReviews.map((review: any) => {
|
||||||
return {
|
return {
|
||||||
@ -16,16 +14,21 @@ export async function getStaticPaths() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(
|
const reviews = await memorium.listResource(
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
`http://localhost:8080/resources?name=Media/movies/${Astro.params.movieName}.md`,
|
`Media/movies/${Astro.params.movieName}.md`,
|
||||||
);
|
);
|
||||||
const reviewes = await response.json();
|
|
||||||
const review = reviewes[0];
|
if (reviews.length === 0) {
|
||||||
|
return new Response(null, {
|
||||||
|
status: 404,
|
||||||
|
statusText: "Not found",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const review = reviews[0];
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
import HeroCard from "@components/HeroCard.astro";
|
import HeroCard from "@components/HeroCard.astro";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
const response = await fetch(
|
const movieReviews = await memorium.listResource("Media/movies/*");
|
||||||
"http://localhost:8080/resources?name=Media/movies/*",
|
|
||||||
);
|
|
||||||
const movieReviews = await response.json();
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
@ -2,16 +2,15 @@
|
|||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
import { useTranslatedPath } from "@i18n/utils";
|
import { useTranslatedPath } from "@i18n/utils";
|
||||||
import markdownToText from "@helpers/markdownToText";
|
import markdownToText from "@helpers/markdownToText";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
const path = useTranslatedPath(Astro.url);
|
const path = useTranslatedPath(Astro.url);
|
||||||
|
|
||||||
const collection = "resources/recipes";
|
const collection = "resources/recipes";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const response = await fetch(
|
|
||||||
"http://localhost:8080/resources?name=Recipes/*",
|
const recipes = await memorium.listResource("Recipes/*");
|
||||||
);
|
|
||||||
const recipes = await response.json();
|
|
||||||
|
|
||||||
const paths = recipes.map((recipe: any) => {
|
const paths = recipes.map((recipe: any) => {
|
||||||
return {
|
return {
|
||||||
@ -26,11 +25,17 @@ export async function getStaticPaths() {
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(
|
|
||||||
|
const recipes = await memorium.listResource(
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
`http://localhost:8080/resources?name=Recipes/${Astro.params.recipeName}.md`,
|
`Recipes/${Astro.params.recipeName}.md`,
|
||||||
);
|
);
|
||||||
const recipes = await response.json();
|
if (recipes.length === 0) {
|
||||||
|
return new Response(null, {
|
||||||
|
status: 404,
|
||||||
|
statusText: "Not found",
|
||||||
|
});
|
||||||
|
}
|
||||||
const recipe = recipes[0];
|
const recipe = recipes[0];
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
import HeroCard from "@components/HeroCard.astro";
|
import HeroCard from "@components/HeroCard.astro";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
const response = await fetch("http://localhost:8080/resources?name=Recipes/*");
|
const recipes = await memorium.listResource("Recipes/*");
|
||||||
const recipes = await response.json();
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
---
|
---
|
||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
import { useTranslatedPath } from "@i18n/utils";
|
import { useTranslatedPath } from "@i18n/utils";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
const collection = "resources/series";
|
const collection = "resources/series";
|
||||||
|
|
||||||
const path = useTranslatedPath(Astro.url);
|
const path = useTranslatedPath(Astro.url);
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const response = await fetch(
|
const seriesReviews = await memorium.listResource("Media/series/*");
|
||||||
"http://localhost:8080/resources?name=Media/series/*",
|
|
||||||
);
|
|
||||||
const seriesReviews = await response.json();
|
|
||||||
|
|
||||||
const paths = seriesReviews.map((review:any) => {
|
const paths = seriesReviews.map((review: any) => {
|
||||||
return {
|
return {
|
||||||
params: {
|
params: {
|
||||||
seriesName: review.identifier
|
seriesName: review.identifier
|
||||||
@ -25,12 +23,18 @@ export async function getStaticPaths() {
|
|||||||
return paths;
|
return paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = await fetch(
|
|
||||||
|
const reviews = await memorium.listResource(
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
`http://localhost:8080/resources?name=Media/series/${Astro.params.seriesName}.md`,
|
`Media/series/${Astro.params.seriesName}.md`,
|
||||||
);
|
);
|
||||||
const reviewes = response.ok ? await response.json() : [];
|
if (reviews.length === 0) {
|
||||||
const review = reviewes[0];
|
return new Response(null, {
|
||||||
|
status: 404,
|
||||||
|
statusText: "Not found",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const review = reviews[0];
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
import Layout from "@layouts/Layout.astro";
|
import Layout from "@layouts/Layout.astro";
|
||||||
import HeroCard from "@components/HeroCard.astro";
|
import HeroCard from "@components/HeroCard.astro";
|
||||||
|
import * as memorium from "@helpers/memorium";
|
||||||
|
|
||||||
const response = await fetch(
|
const seriesReviewes = await memorium.listResource("Media/series/*");
|
||||||
"http://localhost:8080/resources?name=Media/series/*",
|
|
||||||
);
|
|
||||||
const seriesReviewes = await response.json();
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title="Max Richter">
|
<Layout title="Max Richter">
|
||||||
|
Reference in New Issue
Block a user