Notes2/views/pages/notes2.gotmpl

24 lines
593 B
Go Template
Raw Normal View History

2024-11-28 18:11:14 +01:00
{{ define "page" }}
2024-11-29 09:15:42 +01:00
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/notes2.css">
2024-11-28 18:11:14 +01:00
<script type="module">
import { h, Component, render, createRef } from 'preact'
import htm from 'htm'
{{ if .Data._dev -}}
import 'preact/debug'
import 'preact/devtools'
{{- end }}
import { Notes2 } from "/js/{{ .VERSION }}/app.mjs"
import { API } from 'api'
if (!API.hasAuthenticationToken()) {
location.href = '/login'
} else {
const html = htm.bind(h)
window._notes2 = createRef()
render(html`<${Notes2} ref=${window._notes2} />`, document.getElementById('app'))
}
</script>
{{ end }}