swaf/views/layouts/svelte_layout.html

30 lines
615 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
%head%
<style>%css%</style>
<script type="module" defer>
import View from '/js/%canonicalViewName%.js';
const props = %props%;
new View({
hydrate: true,
target: document.body,
props: {
swaf: (key, args) => {
const line = args ?
`'${key}', ${JSON.stringify(args)}`
: `'${key}'`;
return props[line];
},
},
});
</script>
</head>
<body>
%html%
</body>
</html>