This commit is contained in:
Adam Matthiesen 2024-01-19 04:58:37 -08:00
parent dd0f36b84e
commit 4825552c9d
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "@matthiesenxyz/astro-ghostcms", "name": "@matthiesenxyz/astro-ghostcms",
"description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content", "description": "Astro GhostCMS integration to allow easier importing of GhostCMS Content",
"version": "2.0.8", "version": "2.0.9",
"author": "MatthiesenXYZ (https://matthiesen.xyz)", "author": "MatthiesenXYZ (https://matthiesen.xyz)",
"type": "module", "type": "module",
"license": "MIT", "license": "MIT",

View File

@ -10,9 +10,9 @@ export const getGhostImgPath = (
const relativePath = imgUrl.substring(`${baseUrl}/content/images`.length); const relativePath = imgUrl.substring(`${baseUrl}/content/images`.length);
const cleanedBaseUrl = baseUrl.replace(/\/~/, ""); const cleanedBaseUrl = baseUrl.replace(/\/~/, "");
if (width && width > 0) { if (width && width > 0) {
return `${cleanedBaseUrl}/content/images/size/w${width}/${relativePath}`; return `${cleanedBaseUrl}content/images/size/w${width}/${relativePath}`;
} }
return `${cleanedBaseUrl}/content/images/${width}${relativePath}`; return `${cleanedBaseUrl}content/images/${width}${relativePath}`;
}; };
export const truncate = (input: string, size: number): string => export const truncate = (input: string, size: number): string =>