about summary refs log tree commit diff stats
path: root/internal/builder/page.templ
diff options
context:
space:
mode:
Diffstat (limited to 'internal/builder/page.templ')
-rw-r--r--internal/builder/page.templ8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/builder/page.templ b/internal/builder/page.templ
index c99e315..7b3380f 100644
--- a/internal/builder/page.templ
+++ b/internal/builder/page.templ
@@ -52,6 +52,14 @@ templ page(site config.Config, page PageSettings) {
 				<a href="https://opensource.org/licenses/MIT">MIT</a>
 			</footer>
 			@counter(page.Path, page.Title)
+			if site.InjectLiveReload {
+				<script defer>
+					new EventSource("/_/reload").onmessage = event => {
+						console.log("got message", event)
+						window.location.reload()
+					};
+				</script>
+			}
 		</body>
 	</html>
 }