add reload shortcode

reload site after n secounds
This commit is contained in:
6543 2019-07-14 03:18:41 +02:00
parent 0e4a1a46a0
commit 7f5457f380
Signed by: 6543
GPG Key ID: A1CA74D27FD13271

View File

@ -0,0 +1,13 @@
{{ $seconds := .Get 0 }}
{{ $ms := ( printf "%s%s" $seconds "000" )}}
<script>
function Sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}

async function reload(){
await Sleep({{ $ms }});
location.reload();
}
reload();
</script>