misc: livereload setup (#70112)

This commit is contained in:
Agate 2022-10-11 15:33:08 +02:00
parent 6746c330f4
commit 3e2a8d432a
3 changed files with 19 additions and 0 deletions

7
compile-and-reload.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# add a trap to ensure our livereload
# is stopped properly on ctrl-c
trap 'kill %1' SIGINT
./livereload-server & iwatch -r -t '.scss' -e modify -c "make css" .

9
livereload-server Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/python3
from livereload import Server, shell
server = Server()
server.watch('static/**/*.css', 'echo "reloading"')
server.serve(liveport=35729)

View File

@ -63,6 +63,9 @@
{% if not no_extra_js %}
<script src="{{site_base}}{% static "" %}{{css_variant}}/extra.js?{% start_timestamp %}" async></script>
{% endif %}
{% if livereload_enabled %}
<script src="{{site_base}}/livereload/livereload.js?host={{ request.get_host }}&port=443" async></script>
{% endif %}
{% skeleton_extra_placeholder extra-head %}
{% end_skeleton_extra_placeholder %}
{% endblock %}