From 45a2e290aa2bc59deb5971255accba517500cc25 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 19 Jun 2024 13:50:37 +0200 Subject: fix dev server/live reload --- internal/builder/builder.go | 1 + internal/builder/page.templ | 8 ++++++++ internal/builder/template.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'internal/builder') diff --git a/internal/builder/builder.go b/internal/builder/builder.go index b4ade4a..44ab402 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -267,5 +267,6 @@ func BuildSite(ioConfig IOConfig) (*Result, error) { } } + loadCSS() return build(ioConfig.Destination, *config) } 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) { MIT @counter(page.Path, page.Title) + if site.InjectLiveReload { + + } } diff --git a/internal/builder/template.go b/internal/builder/template.go index 9b1d9bd..53199fc 100644 --- a/internal/builder/template.go +++ b/internal/builder/template.go @@ -30,7 +30,7 @@ var ( } ) -func init() { +func loadCSS() { bytes, err := os.ReadFile("templates/style.css") if err != nil { panic(err) -- cgit 1.4.1