2024-08-04 16:15:09 +02:00
|
|
|
import markdownit from "markdown-it";
|
|
|
|
|
import hljs from "highlight.js";
|
2024-08-14 19:33:41 +02:00
|
|
|
import { dev } from "$app/environment";
|
2024-08-04 16:15:09 +02:00
|
|
|
|
2024-07-31 07:23:32 +02:00
|
|
|
export const sortOptions = [
|
|
|
|
|
{ value: "creation-time", text: "Creation time" },
|
|
|
|
|
{ value: "last-modified", text: "Last modified" },
|
|
|
|
|
{ value: "title-a-to-z", text: "Title - A to Z" },
|
|
|
|
|
{ value: "title-z-to-a", text: "Title - Z to A" }
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/svg+xml", "image/webp"];
|
2024-08-04 16:15:09 +02:00
|
|
|
|
|
|
|
|
export const md = markdownit({
|
|
|
|
|
linkify: true,
|
|
|
|
|
typographer: true,
|
|
|
|
|
highlight: (str, lang) => {
|
|
|
|
|
if (lang && hljs.getLanguage(lang)) {
|
|
|
|
|
try {
|
|
|
|
|
return hljs.highlight(str, { language: lang }).value;
|
|
|
|
|
} catch (_) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-08-14 19:33:41 +02:00
|
|
|
|
|
|
|
|
export const API_BASE_PREFIX = dev ? "http://localhost:3000" : "/api";
|
2024-08-17 22:07:16 +02:00
|
|
|
export const NGINX_BASE_PREFIX = dev ? "http://localhost:18000" : "";
|