Redmage/views/components/head.templ

28 lines
732 B
Plaintext

package components
import "github.com/tigorlazuardi/redmage/views"
templ Head(vc *views.Context, extras ...templ.Component) {
<head>
<script>
document.querySelector('html').dataset.theme = localStorage.getItem('theme') || '';
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="keywords" content="Reddit, Image, Downloader"/>
<link rel="stylesheet" href="/public/style.css"/>
<link rel="icon" href="/public/favicon.svg"/>
@Dayjs(vc)
@HTMX(vc)
if vc.Config.Bool("http.hotreload") {
<script src="/public/hot_reload.js"></script>
}
for _, extra := range extras {
@extra
}
</head>
}
templ HeadTitle(name string) {
<title>{ name }</title>
}