diff --git a/.gitignore b/.gitignore index 36e4935..1ba5dab 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ bun.lock .env /uploads .idea +temp +.vscode/settings.json diff --git a/package.json b/package.json index cea47bb..c82425e 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "fluent-ffmpeg": "^2.1.3", "image-thumbnail": "^1.0.17", "luxon": "^3.6.1", + "preact-render-to-string": "^6.5.13", "redis": "^4.7.0" } } diff --git a/src/components/head.tsx b/src/components/head.tsx new file mode 100644 index 0000000..b519547 --- /dev/null +++ b/src/components/head.tsx @@ -0,0 +1,42 @@ +import type { FunctionalComponent, JSX } from "preact"; + +export const Head: FunctionalComponent = ({ + title, + styles, + scripts, +}): JSX.Element => ( + <> + + + + + {title && {title}} + + + + {styles?.map( + (style): JSX.Element => ( + + ), + )} + + {scripts?.map( + (script: string | [string, boolean]): JSX.Element | undefined => { + if (typeof script === "string") { + return