mirror of
https://git.waldn.net/git/knotteye/satyr.git
synced 2025-09-07 05:18:02 +00:00
initial work on client-side templating
This commit is contained in:
37
site/index.html
Normal file
37
site/index.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<script src="/nunjucks-slim.js"></script>
|
||||
<script src="/templates.js"></script>
|
||||
<script>
|
||||
nunjucks.configure({ autoescape: true });
|
||||
</script>
|
||||
</head>
|
||||
<body onload="render()">
|
||||
<script>
|
||||
function render(){
|
||||
switch(window.location.pathname){
|
||||
case "/about.html":
|
||||
document.body.innerHTML = nunjucks.render('about.html');
|
||||
break;
|
||||
case "/tos.html":
|
||||
document.body.innerHTML = nunjucks.render('tos.html');
|
||||
break;
|
||||
default:
|
||||
document.body.innerHTML = nunjucks.render('404.njk');
|
||||
}
|
||||
}
|
||||
function getContext(){
|
||||
var conf = {
|
||||
sitename: "",
|
||||
domain: "",
|
||||
email: "",
|
||||
version: "",
|
||||
registration: false
|
||||
}
|
||||
var info = new XMLHttpRequest();
|
||||
info.onload = () => {
|
||||
if(xhr.status === 200)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
Reference in New Issue
Block a user