markdown insert media

This commit is contained in:
2026-05-14 22:49:47 +03:00
parent 8cd80c016f
commit f99aadee83
9 changed files with 207 additions and 197 deletions
+8
View File
@@ -6,6 +6,14 @@ export function imgurl(channel, file) {
return channel.filesUrl + `/thumbs/${webpPath}`;
}
export function presetUrl(channel, file, preset) {
if (file.mime === "image/svg+xml") {
return fileurl(channel, file);
}
const webpPath = file.path.slice(0, file.path.lastIndexOf(".")) + ".webp";
return channel.filesUrl + `/templates/${preset}/${webpPath}`;
}
export function fileurl(channel, file) {
return channel.filesUrl + `/${file.path}`;
}