transform autoreload from macro to included html

This commit is contained in:
leafee98 2023-10-24 15:03:03 +08:00
parent c566536dfd
commit eb13d4f4a0
2 changed files with 5 additions and 8 deletions

4
template/autoreload.html Normal file
View file

@ -0,0 +1,4 @@
<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
':35729/livereload.js?snipver=1"></' + 'script>')
</script>

View file

@ -1,12 +1,5 @@
<!DOCTYPE html>
{% macro autoreload() %}
<script>
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] +
':35729/livereload.js?snipver=1"></' + 'script>')
</script>
{% endmacro %}
{% macro unhide_func() %}
<script>
function unhide(seed, arr) {
@ -83,7 +76,7 @@
<html>
<head>
{% if dev %}
{{ autoreload() }}
{% include "autoreload.html" %}
{% endif %}
<title>{{ name }}</title>