swaf/assets/views/layouts/svelte_layout.html

31 lines
726 B
HTML
Raw Normal View History

2021-03-24 16:07:50 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
%head%
<style>%css%</style>
<script type="module" defer>
import View from '/js/views/%canonicalViewName%.js';
import * as stores from '/js/stores.js';
const localStore = stores[Object.keys(stores)[0]].locals;
2021-03-24 16:07:50 +01:00
const locals = %locals%;
localStore.set((key, args) => {
const localKey = args ?
`'${key}', \`${args}\``
: `'${key}'`;
// console.debug(localKey + '=' + locals[localKey])
return locals[localKey];
});
2021-03-24 16:07:50 +01:00
new View({
hydrate: true,
target: document.body,
});
</script>
</head>
<body>
%html%
</body>
</html>