23 lines
515 B
Go Template
23 lines
515 B
Go Template
{{ define "page" }}
|
|
|
|
<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 }}
|