first commit

This commit is contained in:
Lee
2024-09-08 22:35:32 +01:00
parent 5d86ed4b26
commit c8a7aa7d1d
51 changed files with 5299 additions and 5179 deletions

View File

@ -0,0 +1,15 @@
import { config } from "../../../config";
/**
* Proxies all non-localhost images to make them load faster.
*
* @param originalUrl the original image url
* @returns the new image url
*/
export function getImageUrl(originalUrl: string) {
// Remove the prepending slash
if (originalUrl.startsWith("/")) {
originalUrl = originalUrl.substring(1);
}
return `${!config.siteUrl.includes("localhost") ? "https://img.fascinated.cc/upload/q_70/" : ""}${originalUrl}`;
}