homepage/layouts/shortcodes/reload.html

14 lines
276 B
HTML
Raw Permalink Normal View History

{{ $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>