diff --git a/src/components/CardSmall.svelte b/src/components/CardSmall.svelte
index 3619469..9216160 100644
--- a/src/components/CardSmall.svelte
+++ b/src/components/CardSmall.svelte
@@ -3,6 +3,7 @@
import Actions from "./Actions.svelte";
import ColorSwitcher from "./ColorSwitcher.svelte";
import { getDefaultLogoColor } from "../utils/colorTheme.js";
+ import { collections } from '../collections.js';
export let logo;
export let theme;
@@ -23,6 +24,20 @@
}
$: getLogoThemeColor = (logo) => getDefaultLogoColor(logo.colors, theme);
+
+ function getCollectionByPath(path) {
+ return collections.find(col => path.startsWith(col.baseDir.replace('images/', '')) || path.startsWith(col.baseDir));
+ }
+
+ function getBaseDir(logo) {
+ const collection = getCollectionByPath(logo.path);
+ return collection ? collection.baseDir : 'images/logos';
+ }
+
+ function getImageUrl(logo) {
+ const baseDir = getBaseDir(logo);
+ return `/${baseDir}/${logo.path.split('/').pop()}`;
+ }
diff --git a/src/components/CardTiny.svelte b/src/components/CardTiny.svelte
index a65415a..1402997 100644
--- a/src/components/CardTiny.svelte
+++ b/src/components/CardTiny.svelte
@@ -2,6 +2,7 @@
import InlineSvg from "./InlineSvg.svelte";
import { getDefaultLogoColor } from "../utils/colorTheme.js";
import ColorSwitcher from './ColorSwitcher.svelte';
+ import { collections } from '../collections.js';
export let logo;
export let theme;
@@ -30,6 +31,20 @@
$: getLogoThemeColor = (logo) => getDefaultLogoColor(logo.colors, theme);
+ function getCollectionByPath(path) {
+ return collections.find(col => path.startsWith(col.baseDir.replace('images/', '')) || path.startsWith(col.baseDir));
+ }
+
+ function getBaseDir(logo) {
+ const collection = getCollectionByPath(logo.path);
+ return collection ? collection.baseDir : 'images/logos';
+ }
+
+ function getImageUrl(logo) {
+ const baseDir = getBaseDir(logo);
+ return `/${baseDir}/${logo.path.split('/').pop()}`;
+ }
+
{#if isSvgLogo(logo)}
{:else}
-

+
})
{/if}
{#if logo.colors}