mirror of
https://github.com/mikkelsvartveit/astro-personal-website.git
synced 2025-12-22 11:12:38 +00:00
Fix photo URLs
This commit is contained in:
parent
d8fb432578
commit
85c3b6174b
1 changed files with 3 additions and 1 deletions
|
|
@ -16,7 +16,9 @@ const sortFiles = (a: any, b: any) => {
|
|||
|
||||
export const getFileNameFromPath = (path: string) => {
|
||||
const parts = path.split("/");
|
||||
return parts[parts.length - 1].split("?")[0];
|
||||
const fileName = parts[parts.length - 1].split("?")[0];
|
||||
const fileNameParts = fileName.split(".");
|
||||
return fileNameParts[0] + "." + fileNameParts[fileNameParts.length - 1];
|
||||
};
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue