fix: images in remotes
All checks were successful
Deploy to SFTP Server / build (push) Successful in 9m22s

This commit is contained in:
Max Richter
2025-10-22 16:00:21 +02:00
parent 2446629515
commit 24a66940e9
6 changed files with 129 additions and 131 deletions

View File

@@ -1,12 +1,12 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from "astro/config";
import { i18n, filterSitemapByDefaultLocale } from "astro-i18n-aut/integration"; import { filterSitemapByDefaultLocale, i18n } from "astro-i18n-aut/integration";
import sitemap from "@astrojs/sitemap"; import sitemap from "@astrojs/sitemap";
import Icons from 'unplugin-icons/vite' import Icons from "unplugin-icons/vite";
import mdx from '@astrojs/mdx'; import mdx from "@astrojs/mdx";
import glsl from 'vite-plugin-glsl'; import glsl from "vite-plugin-glsl";
import svelte from "@astrojs/svelte"; import svelte from "@astrojs/svelte";
import UnoCSS from 'unocss/astro' import UnoCSS from "unocss/astro";
const defaultLocale = "de"; const defaultLocale = "de";
const locales = { const locales = {
@@ -14,7 +14,7 @@ const locales = {
de: "de", de: "de",
}; };
const DEFAULT_LAYOUT = '@layouts/Post.astro'; const DEFAULT_LAYOUT = "@layouts/Post.astro";
function setDefaultLayout() { function setDefaultLayout() {
return function(_, file) { return function(_, file) {
@@ -27,6 +27,9 @@ export default defineConfig({
site: "https://max-richter.dev", site: "https://max-richter.dev",
trailingSlash: "never", trailingSlash: "never",
prefetch: true, prefetch: true,
image: {
remotePatterns: [{ protocol: "https" }],
},
build: { build: {
format: "file", format: "file",
}, },
@@ -34,30 +37,30 @@ export default defineConfig({
plugins: [ plugins: [
glsl(), glsl(),
Icons({ Icons({
compiler: 'svelte', compiler: "svelte",
}), }),
], ],
server: { server: {
watch: { watch: {
// Customize watch behavior to reduce file watchers // Customize watch behavior to reduce file watchers
ignored: ['**/node_modules/**', '**/dist/**', '**/.git/**'], ignored: ["**/node_modules/**", "**/dist/**", "**/.git/**"],
usePolling: process.env.NODE_ENV === 'production', usePolling: process.env.NODE_ENV === "production",
}, },
}, },
}, },
markdown: { markdown: {
remarkPlugins: [setDefaultLayout] remarkPlugins: [setDefaultLayout],
}, },
integrations: [ integrations: [
i18n({ i18n({
exclude: ["pages/**/*.json.ts", "pages/api/**/*",], exclude: ["pages/**/*.json.ts", "pages/api/**/*"],
locales, locales,
defaultLocale, defaultLocale,
}), }),
mdx(), mdx(),
svelte(), svelte(),
UnoCSS({ UnoCSS({
injectReset: true injectReset: true,
}), }),
sitemap({ sitemap({
i18n: { i18n: {
@@ -66,5 +69,5 @@ export default defineConfig({
}, },
filter: filterSitemapByDefaultLocale({ defaultLocale }), filter: filterSitemapByDefaultLocale({ defaultLocale }),
}), }),
] ],
}); });

View File

@@ -10,11 +10,11 @@
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.4", "@astrojs/check": "^0.9.5",
"@astrojs/mdx": "^4.3.6", "@astrojs/mdx": "^4.3.7",
"@astrojs/svelte": "^7.2.0", "@astrojs/svelte": "^7.2.0",
"@astrojs/tailwind": "^6.0.2", "@astrojs/tailwind": "^6.0.2",
"astro": "^5.14.1", "astro": "^5.14.8",
"astro-i18n-aut": "^0.7.3", "astro-i18n-aut": "^0.7.3",
"exifreader": "^4.32.0", "exifreader": "^4.32.0",
"svelte": "^5.39.8", "svelte": "^5.39.8",

144
pnpm-lock.yaml generated
View File

@@ -9,23 +9,23 @@ importers:
.: .:
dependencies: dependencies:
'@astrojs/check': '@astrojs/check':
specifier: ^0.9.4 specifier: ^0.9.5
version: 0.9.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3) version: 0.9.5(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)
'@astrojs/mdx': '@astrojs/mdx':
specifier: ^4.3.6 specifier: ^4.3.7
version: 4.3.6(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)) version: 4.3.7(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))
'@astrojs/svelte': '@astrojs/svelte':
specifier: ^7.2.0 specifier: ^7.2.0
version: 7.2.0(@types/node@24.6.2)(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(jiti@2.6.1)(svelte@5.39.8)(typescript@5.9.3)(yaml@2.8.1) version: 7.2.0(@types/node@24.6.2)(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(jiti@2.6.1)(svelte@5.39.8)(typescript@5.9.3)(yaml@2.8.1)
'@astrojs/tailwind': '@astrojs/tailwind':
specifier: ^6.0.2 specifier: ^6.0.2
version: 6.0.2(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(tailwindcss@4.1.14) version: 6.0.2(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(tailwindcss@4.1.14)
astro: astro:
specifier: ^5.14.1 specifier: ^5.14.8
version: 5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1) version: 5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)
astro-i18n-aut: astro-i18n-aut:
specifier: ^0.7.3 specifier: ^0.7.3
version: 0.7.3(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)) version: 0.7.3(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))
exifreader: exifreader:
specifier: ^4.32.0 specifier: ^4.32.0
version: 4.32.0 version: 4.32.0
@@ -96,8 +96,8 @@ packages:
'@antfu/utils@9.2.1': '@antfu/utils@9.2.1':
resolution: {integrity: sha512-TMilPqXyii1AsiEii6l6ubRzbo76p6oshUSYPaKsmXDavyMLqjzVDkcp3pHp5ELMUNJHATcEOGxKTTsX9yYhGg==} resolution: {integrity: sha512-TMilPqXyii1AsiEii6l6ubRzbo76p6oshUSYPaKsmXDavyMLqjzVDkcp3pHp5ELMUNJHATcEOGxKTTsX9yYhGg==}
'@astrojs/check@0.9.4': '@astrojs/check@0.9.5':
resolution: {integrity: sha512-IOheHwCtpUfvogHHsvu0AbeRZEnjJg3MopdLddkJE70mULItS/Vh37BHcI00mcOJcH1vhD3odbpvWokpxam7xA==} resolution: {integrity: sha512-88vc8n2eJ1Oua74yXSGo/8ABMeypfQPGEzuoAx2awL9Ju8cE6tZ2Rz9jVx5hIExHK5gKVhpxfZj4WXm7e32g1w==}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
typescript: ^5.0.0 typescript: ^5.0.0
@@ -105,8 +105,8 @@ packages:
'@astrojs/compiler@2.13.0': '@astrojs/compiler@2.13.0':
resolution: {integrity: sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw==} resolution: {integrity: sha512-mqVORhUJViA28fwHYaWmsXSzLO9osbdZ5ImUfxBarqsYdMlPbqAqGJCxsNzvppp1BEzc1mJNjOVvQqeDN8Vspw==}
'@astrojs/internal-helpers@0.7.3': '@astrojs/internal-helpers@0.7.4':
resolution: {integrity: sha512-6Pl0bQEIChuW5wqN7jdKrzWfCscW2rG/Cz+fzt4PhSQX2ivBpnhXgFUCs0M3DCYvjYHnPVG2W36X5rmFjZ62sw==} resolution: {integrity: sha512-lDA9MqE8WGi7T/t2BMi+EAXhs4Vcvr94Gqx3q15cFEz8oFZMO4/SFBqYr/UcmNlvW+35alowkVj+w9VhLvs5Cw==}
'@astrojs/language-server@2.15.4': '@astrojs/language-server@2.15.4':
resolution: {integrity: sha512-JivzASqTPR2bao9BWsSc/woPHH7OGSGc9aMxXL4U6egVTqBycB3ZHdBJPuOCVtcGLrzdWTosAqVPz1BVoxE0+A==} resolution: {integrity: sha512-JivzASqTPR2bao9BWsSc/woPHH7OGSGc9aMxXL4U6egVTqBycB3ZHdBJPuOCVtcGLrzdWTosAqVPz1BVoxE0+A==}
@@ -120,11 +120,11 @@ packages:
prettier-plugin-astro: prettier-plugin-astro:
optional: true optional: true
'@astrojs/markdown-remark@6.3.7': '@astrojs/markdown-remark@6.3.8':
resolution: {integrity: sha512-KXGdq6/BC18doBCYXp08alHlWChH0hdD2B1qv9wIyOHbvwI5K6I7FhSta8dq1hBQNdun8YkKPR013D/Hm8xd0g==} resolution: {integrity: sha512-uFNyFWadnULWK2cOw4n0hLKeu+xaVWeuECdP10cQ3K2fkybtTlhb7J7TcScdjmS8Yps7oje9S/ehYMfZrhrgCg==}
'@astrojs/mdx@4.3.6': '@astrojs/mdx@4.3.7':
resolution: {integrity: sha512-jH04tYgaqLfq3To42+z1oEcXrXUzo3BxZ4fTkb+7BEmOJkQ9/c3iIixFEC+x0GgE8lJb4SuEDGldpAv7+1yY8A==} resolution: {integrity: sha512-5SRmvMyT/UMWaU2eoD+htnXtE2mUZZEH2K/nEzhuEy+iCsOSuS/DUry59WuKUJRQETi1mgJFdNR4dZLJHYVuRA==}
engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0}
peerDependencies: peerDependencies:
astro: ^5.0.0 astro: ^5.0.0
@@ -195,8 +195,9 @@ packages:
resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
'@capsizecss/unpack@2.4.0': '@capsizecss/unpack@3.0.0':
resolution: {integrity: sha512-GrSU71meACqcmIUxPYOJvGKF0yryjN/L1aCuE9DViCTJI7bfkjgYDPD1zbNDcINJwSSP6UaBZY9GAbYDO7re0Q==} resolution: {integrity: sha512-+ntATQe1AlL7nTOYjwjj6w3299CgRot48wL761TUGYpYgAou3AaONZazp0PKZyCyWhudWsjhq1nvRHOvbMzhTA==}
engines: {node: '>=18'}
'@emmetio/abbreviation@2.3.3': '@emmetio/abbreviation@2.3.3':
resolution: {integrity: sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==} resolution: {integrity: sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA==}
@@ -962,8 +963,8 @@ packages:
peerDependencies: peerDependencies:
astro: ^5.0.0 astro: ^5.0.0
astro@5.14.1: astro@5.14.8:
resolution: {integrity: sha512-gPa8NY7/lP8j8g81iy8UwANF3+aukKRWS68IlthZQNgykpg80ne6lbHOp6FErYycxQ1TUhgEfkXVDQZAoJx8Bg==} resolution: {integrity: sha512-nKqCLs7BFvGQL9QWQOUqxHhlHtV0UMLXz1ANJygozvjcexBWS7FYkWI2LzRPMNYmbW4msIWNWnX2RvLdvI5Cnw==}
engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'}
hasBin: true hasBin: true
@@ -995,9 +996,6 @@ packages:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'} engines: {node: '>=8'}
blob-to-buffer@1.2.9:
resolution: {integrity: sha512-BF033y5fN6OCofD3vgHmNtwZWRcq9NLyyxyILx9hfMy1sXYy4ojFl765hJ2lP0YaN2fuxPaLO2Vzzoxy0FLFFA==}
boxen@8.0.1: boxen@8.0.1:
resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==} resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==}
engines: {node: '>=18'} engines: {node: '>=18'}
@@ -1108,9 +1106,6 @@ packages:
resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==}
engines: {node: '>=18'} engines: {node: '>=18'}
cross-fetch@3.2.0:
resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==}
crossws@0.3.5: crossws@0.3.5:
resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==} resolution: {integrity: sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==}
@@ -1740,15 +1735,6 @@ packages:
node-fetch-native@1.6.7: node-fetch-native@1.6.7:
resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==}
node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
node-mock-http@1.0.3: node-mock-http@1.0.3:
resolution: {integrity: sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==} resolution: {integrity: sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==}
@@ -2105,9 +2091,6 @@ packages:
tiny-inflate@1.0.3: tiny-inflate@1.0.3:
resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==}
tinyexec@0.3.2:
resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==}
tinyexec@1.0.1: tinyexec@1.0.1:
resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==}
@@ -2123,9 +2106,6 @@ packages:
resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
tr46@0.0.3:
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
trim-lines@3.0.1: trim-lines@3.0.1:
resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}
@@ -2187,8 +2167,8 @@ packages:
unified@11.0.5: unified@11.0.5:
resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==}
unifont@0.5.2: unifont@0.6.0:
resolution: {integrity: sha512-LzR4WUqzH9ILFvjLAUU7dK3Lnou/qd5kD+IakBtBK4S15/+x2y9VX+DcWQv6s551R6W+vzwgVS6tFg3XggGBgg==} resolution: {integrity: sha512-5Fx50fFQMQL5aeHyWnZX9122sSLckcDvcfFiBf3QYeHa7a1MKJooUy52b67moi2MJYkrfo/TWY+CoLdr/w0tTA==}
unist-util-find-after@5.0.0: unist-util-find-after@5.0.0:
resolution: {integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==} resolution: {integrity: sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==}
@@ -2517,15 +2497,9 @@ packages:
web-namespaces@2.0.1: web-namespaces@2.0.1:
resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
webpack-virtual-modules@0.6.2: webpack-virtual-modules@0.6.2:
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
whatwg-url@5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
which-pm-runs@1.1.0: which-pm-runs@1.1.0:
resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==} resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==}
engines: {node: '>=4'} engines: {node: '>=4'}
@@ -2611,7 +2585,7 @@ snapshots:
'@antfu/utils@9.2.1': {} '@antfu/utils@9.2.1': {}
'@astrojs/check@0.9.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)': '@astrojs/check@0.9.5(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)':
dependencies: dependencies:
'@astrojs/language-server': 2.15.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3) '@astrojs/language-server': 2.15.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)
chokidar: 4.0.3 chokidar: 4.0.3
@@ -2624,7 +2598,7 @@ snapshots:
'@astrojs/compiler@2.13.0': {} '@astrojs/compiler@2.13.0': {}
'@astrojs/internal-helpers@0.7.3': {} '@astrojs/internal-helpers@0.7.4': {}
'@astrojs/language-server@2.15.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)': '@astrojs/language-server@2.15.4(prettier-plugin-astro@0.14.1)(prettier@3.6.2)(typescript@5.9.3)':
dependencies: dependencies:
@@ -2652,9 +2626,9 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- typescript - typescript
'@astrojs/markdown-remark@6.3.7': '@astrojs/markdown-remark@6.3.8':
dependencies: dependencies:
'@astrojs/internal-helpers': 0.7.3 '@astrojs/internal-helpers': 0.7.4
'@astrojs/prism': 3.3.0 '@astrojs/prism': 3.3.0
github-slugger: 2.0.0 github-slugger: 2.0.0
hast-util-from-html: 2.0.3 hast-util-from-html: 2.0.3
@@ -2678,12 +2652,12 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@astrojs/mdx@4.3.6(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))': '@astrojs/mdx@4.3.7(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))':
dependencies: dependencies:
'@astrojs/markdown-remark': 6.3.7 '@astrojs/markdown-remark': 6.3.8
'@mdx-js/mdx': 3.1.1 '@mdx-js/mdx': 3.1.1
acorn: 8.15.0 acorn: 8.15.0
astro: 5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1) astro: 5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)
es-module-lexer: 1.7.0 es-module-lexer: 1.7.0
estree-util-visit: 2.0.0 estree-util-visit: 2.0.0
hast-util-to-html: 9.0.5 hast-util-to-html: 9.0.5
@@ -2707,10 +2681,10 @@ snapshots:
stream-replace-string: 2.0.0 stream-replace-string: 2.0.0
zod: 3.25.76 zod: 3.25.76
'@astrojs/svelte@7.2.0(@types/node@24.6.2)(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(jiti@2.6.1)(svelte@5.39.8)(typescript@5.9.3)(yaml@2.8.1)': '@astrojs/svelte@7.2.0(@types/node@24.6.2)(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(jiti@2.6.1)(svelte@5.39.8)(typescript@5.9.3)(yaml@2.8.1)':
dependencies: dependencies:
'@sveltejs/vite-plugin-svelte': 5.1.1(svelte@5.39.8)(vite@6.3.6(@types/node@24.6.2)(jiti@2.6.1)(yaml@2.8.1)) '@sveltejs/vite-plugin-svelte': 5.1.1(svelte@5.39.8)(vite@6.3.6(@types/node@24.6.2)(jiti@2.6.1)(yaml@2.8.1))
astro: 5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1) astro: 5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)
svelte: 5.39.8 svelte: 5.39.8
svelte2tsx: 0.7.44(svelte@5.39.8)(typescript@5.9.3) svelte2tsx: 0.7.44(svelte@5.39.8)(typescript@5.9.3)
typescript: 5.9.3 typescript: 5.9.3
@@ -2729,9 +2703,9 @@ snapshots:
- tsx - tsx
- yaml - yaml
'@astrojs/tailwind@6.0.2(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(tailwindcss@4.1.14)': '@astrojs/tailwind@6.0.2(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1))(tailwindcss@4.1.14)':
dependencies: dependencies:
astro: 5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1) astro: 5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)
autoprefixer: 10.4.21(postcss@8.5.6) autoprefixer: 10.4.21(postcss@8.5.6)
postcss: 8.5.6 postcss: 8.5.6
postcss-load-config: 4.0.2(postcss@8.5.6) postcss-load-config: 4.0.2(postcss@8.5.6)
@@ -2804,13 +2778,9 @@ snapshots:
'@babel/helper-string-parser': 7.27.1 '@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1 '@babel/helper-validator-identifier': 7.27.1
'@capsizecss/unpack@2.4.0': '@capsizecss/unpack@3.0.0':
dependencies: dependencies:
blob-to-buffer: 1.2.9
cross-fetch: 3.2.0
fontkit: 2.0.4 fontkit: 2.0.4
transitivePeerDependencies:
- encoding
'@emmetio/abbreviation@2.3.3': '@emmetio/abbreviation@2.3.3':
dependencies: dependencies:
@@ -3569,9 +3539,9 @@ snapshots:
astro-font@1.1.0: {} astro-font@1.1.0: {}
astro-i18n-aut@0.7.3(astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)): astro-i18n-aut@0.7.3(astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)):
dependencies: dependencies:
astro: 5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1) astro: 5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1)
dedent: 1.7.0 dedent: 1.7.0
fast-glob: 3.3.3 fast-glob: 3.3.3
fs-extra: 11.3.2 fs-extra: 11.3.2
@@ -3579,13 +3549,13 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- babel-plugin-macros - babel-plugin-macros
astro@5.14.1(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1): astro@5.14.8(@types/node@24.6.2)(jiti@2.6.1)(rollup@4.52.4)(typescript@5.9.3)(yaml@2.8.1):
dependencies: dependencies:
'@astrojs/compiler': 2.13.0 '@astrojs/compiler': 2.13.0
'@astrojs/internal-helpers': 0.7.3 '@astrojs/internal-helpers': 0.7.4
'@astrojs/markdown-remark': 6.3.7 '@astrojs/markdown-remark': 6.3.8
'@astrojs/telemetry': 3.3.0 '@astrojs/telemetry': 3.3.0
'@capsizecss/unpack': 2.4.0 '@capsizecss/unpack': 3.0.0
'@oslojs/encoding': 1.1.0 '@oslojs/encoding': 1.1.0
'@rollup/pluginutils': 5.3.0(rollup@4.52.4) '@rollup/pluginutils': 5.3.0(rollup@4.52.4)
acorn: 8.15.0 acorn: 8.15.0
@@ -3627,11 +3597,11 @@ snapshots:
semver: 7.7.2 semver: 7.7.2
shiki: 3.13.0 shiki: 3.13.0
smol-toml: 1.4.2 smol-toml: 1.4.2
tinyexec: 0.3.2 tinyexec: 1.0.1
tinyglobby: 0.2.15 tinyglobby: 0.2.15
tsconfck: 3.1.6(typescript@5.9.3) tsconfck: 3.1.6(typescript@5.9.3)
ultrahtml: 1.6.0 ultrahtml: 1.6.0
unifont: 0.5.2 unifont: 0.6.0
unist-util-visit: 5.0.0 unist-util-visit: 5.0.0
unstorage: 1.17.1 unstorage: 1.17.1
vfile: 6.0.3 vfile: 6.0.3
@@ -3663,7 +3633,6 @@ snapshots:
- '@vercel/kv' - '@vercel/kv'
- aws4fetch - aws4fetch
- db0 - db0
- encoding
- idb-keyval - idb-keyval
- ioredis - ioredis
- jiti - jiti
@@ -3703,8 +3672,6 @@ snapshots:
binary-extensions@2.3.0: {} binary-extensions@2.3.0: {}
blob-to-buffer@1.2.9: {}
boxen@8.0.1: boxen@8.0.1:
dependencies: dependencies:
ansi-align: 3.0.1 ansi-align: 3.0.1
@@ -3804,12 +3771,6 @@ snapshots:
cookie@1.0.2: {} cookie@1.0.2: {}
cross-fetch@3.2.0:
dependencies:
node-fetch: 2.7.0
transitivePeerDependencies:
- encoding
crossws@0.3.5: crossws@0.3.5:
dependencies: dependencies:
uncrypto: 0.1.3 uncrypto: 0.1.3
@@ -4783,10 +4744,6 @@ snapshots:
node-fetch-native@1.6.7: {} node-fetch-native@1.6.7: {}
node-fetch@2.7.0:
dependencies:
whatwg-url: 5.0.0
node-mock-http@1.0.3: {} node-mock-http@1.0.3: {}
node-releases@2.0.23: {} node-releases@2.0.23: {}
@@ -5263,8 +5220,6 @@ snapshots:
tiny-inflate@1.0.3: {} tiny-inflate@1.0.3: {}
tinyexec@0.3.2: {}
tinyexec@1.0.1: {} tinyexec@1.0.1: {}
tinyglobby@0.2.15: tinyglobby@0.2.15:
@@ -5278,8 +5233,6 @@ snapshots:
totalist@3.0.1: {} totalist@3.0.1: {}
tr46@0.0.3: {}
trim-lines@3.0.1: {} trim-lines@3.0.1: {}
trough@2.2.0: {} trough@2.2.0: {}
@@ -5337,7 +5290,7 @@ snapshots:
trough: 2.2.0 trough: 2.2.0
vfile: 6.0.3 vfile: 6.0.3
unifont@0.5.2: unifont@0.6.0:
dependencies: dependencies:
css-tree: 3.1.0 css-tree: 3.1.0
ofetch: 1.4.1 ofetch: 1.4.1
@@ -5614,15 +5567,8 @@ snapshots:
web-namespaces@2.0.1: {} web-namespaces@2.0.1: {}
webidl-conversions@3.0.1: {}
webpack-virtual-modules@0.6.2: {} webpack-virtual-modules@0.6.2: {}
whatwg-url@5.0.0:
dependencies:
tr46: 0.0.3
webidl-conversions: 3.0.1
which-pm-runs@1.1.0: {} which-pm-runs@1.1.0: {}
widest-line@5.0.0: widest-line@5.0.0:

View File

@@ -1,6 +1,7 @@
--- ---
import type { ImageMetadata } from "astro"; import type { ImageMetadata } from "astro";
import { Picture as AstroImage } from "astro:assets"; import { Picture as AstroImage } from "astro:assets";
import { inferRemoteSize } from 'astro/assets/utils';
import { generateThumbHash, getExifData } from "@helpers/image"; import { generateThumbHash, getExifData } from "@helpers/image";
import sharp from "sharp"; import sharp from "sharp";
interface Props { interface Props {
@@ -14,14 +15,16 @@ interface Props {
maxWidth?: number; maxWidth?: number;
} }
async function checkImage(src: string) { async function checkImage(image: ImageMetadata) {
const src = image.src;
try { try {
if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true; if (src.startsWith("/@fs") || src.startsWith("/_astro")) return true;
const res = await sharp(src).metadata(); const res = await inferRemoteSize(src);
if (res.format) { if (res.format) {
image.format = res.format;
return true; return true;
}else { }else {
console.log("Failed to fetch: ", src); console.log("Failed to load: ", src);
} }
return false; return false;
} catch (err) { } catch (err) {
@@ -39,8 +42,8 @@ const {
maxWidth, maxWidth,
} = Astro.props; } = Astro.props;
let thumbhash = hash && image.fsPath ? await generateThumbHash(image) : ""; let thumbhash = hash && await generateThumbHash(image);
const imageOk = await checkImage(image.src); const imageOk = await checkImage(image);
let exif = imageOk && (await getExifData(image)); let exif = imageOk && (await getExifData(image));
@@ -81,5 +84,5 @@ const sizes = [
.join(", ")}> .join(", ")}>
<slot /> <slot />
</AstroImage> </AstroImage>
) : "Image not ok" ) : undefined
} }

View File

@@ -8,11 +8,32 @@ export async function generateThumbHash(
) { ) {
const scaleFactor = 100 / Math.max(image.width, image.height); const scaleFactor = 100 / Math.max(image.width, image.height);
const smallWidth = Math.floor(image.width * scaleFactor); let smallWidth = Math.floor(image.width * scaleFactor);
const smallHeight = Math.floor(image.height * scaleFactor); let smallHeight = Math.floor(image.height * scaleFactor);
try { try {
const smallImg = await sharp(image.fsPath) const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath ??
image.src;
let sp;
if (imagePath.startsWith("https://") || imagePath.startsWith("http://")) {
const res = await fetch(imagePath);
if (!res.ok) {
return;
}
sp = sharp(await res.arrayBuffer());
} else {
sp = sharp(imagePath);
}
if (!smallWidth || !smallHeight) {
const meta = await sp.metadata();
const scaleFactor = 100 / Math.max(meta.width, meta.height);
smallWidth = Math.floor(meta.width * scaleFactor);
smallHeight = Math.floor(meta.height * scaleFactor);
}
const smallImg = await sp
.resize(smallWidth, smallHeight) .resize(smallWidth, smallHeight)
.withMetadata() .withMetadata()
.raw() .raw()
@@ -22,7 +43,10 @@ export async function generateThumbHash(
const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg); const buffer = rgbaToThumbHash(smallWidth, smallHeight, smallImg);
return Buffer.from(buffer).toString("base64"); return Buffer.from(buffer).toString("base64");
} catch (error) { } catch (error) {
console.log(`Could not generate thumbhash for ${image.fsPath}`, error); console.log(
`Could not generate thumbhash for ${image.fsPath ?? image.src}`,
error,
);
return ""; return "";
} }
} }
@@ -45,9 +69,17 @@ 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") if (image.format === "svg") return undefined; // SVGs don't have EXIF data")
const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath; const imagePath = (image as ImageMetadata & { fsPath: string }).fsPath ??
image.src;
try { try {
const buffer = await sharp(imagePath).toBuffer(); let buffer: ArrayBuffer;
if (imagePath.startsWith("https://") || imagePath.startsWith("http://")) {
const res = await fetch(imagePath);
buffer = await res.arrayBuffer();
} else {
buffer = await sharp(imagePath).toBuffer() as unknown as ArrayBuffer;
}
const tags = await ExifReader.load(buffer, { async: true }); const tags = await ExifReader.load(buffer, { async: true });
@@ -62,7 +94,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 from ${imagePath}`, error); console.log(`Error reading EXIF data from ${JSON.stringify(image)}`, error);
return undefined; return undefined;
} }
} }

View File

@@ -3,6 +3,7 @@ import Layout from "@layouts/Layout.astro";
import HeroCard from "@components/HeroCard.astro"; import HeroCard from "@components/HeroCard.astro";
import * as memorium from "@helpers/memorium"; import * as memorium from "@helpers/memorium";
import { resources as resourceTypes } from "../resources.ts"; import { resources as resourceTypes } from "../resources.ts";
import markdownToText from "@helpers/markdownToText";
const { resourceType } = Astro.params; const { resourceType } = Astro.params;
@@ -10,7 +11,7 @@ async function safeGetResource(resType) {
try { try {
return await memorium.listResource(resourceType); return await memorium.listResource(resourceType);
} catch (error) { } catch (error) {
return {content:[]}; return { content: [] };
} }
} }
@@ -26,6 +27,19 @@ export async function getStaticPaths() {
}; };
}); });
} }
function getImageUrl(input: string): string {
if (!input) {
return;
}
if (input.startsWith("https://") || input.startsWith("http://")) {
return input;
}
if (input.startsWith("/")) {
return `https://marka.max-richter.dev${input}`;
}
return `https://marka.max-richter.dev/${input}`;
}
--- ---
<Layout title="Max Richter"> <Layout title="Max Richter">
@@ -40,7 +54,7 @@ export async function getStaticPaths() {
data: { data: {
title: resource.content.name, title: resource.content.name,
cover: { cover: {
src: `https://marka.max-richter.dev/${resource.content.image}`, src: getImageUrl(resource.content.image),
}, },
}, },
}} }}