Generate base user website via template directory

This commit is contained in:
Thilo Hohlt
2024-08-04 16:15:09 +02:00
parent 6b05ab1d28
commit b8ddcdc101
7 changed files with 123 additions and 23 deletions

View File

@@ -1,3 +1,6 @@
import markdownit from "markdown-it";
import hljs from "highlight.js";
export const sortOptions = [
{ value: "creation-time", text: "Creation time" },
{ value: "last-modified", text: "Last modified" },
@@ -6,3 +9,17 @@ export const sortOptions = [
];
export const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/svg+xml", "image/webp"];
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 "";
}
});