{ post.Title }
-- @postDate(post.Date) -
-From a2feb8c63c80a1f52830f562af2deb2c6065eaae Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 24 Jun 2024 21:48:36 +0200 Subject: move templ templates into separate package --- default.nix | 3 ++ internal/builder/404.templ | 13 ----- internal/builder/builder.go | 13 ++--- internal/builder/homepage.templ | 42 --------------- internal/builder/list.templ | 51 ------------------ internal/builder/page.templ | 101 ----------------------------------- internal/builder/post.templ | 51 ------------------ internal/builder/tags.templ | 23 -------- internal/builder/template.go | 12 ++--- templates/404.templ | 13 +++++ templates/homepage.templ | 42 +++++++++++++++ templates/list.templ | 51 ++++++++++++++++++ templates/page.templ | 115 ++++++++++++++++++++++++++++++++++++++++ templates/post.templ | 51 ++++++++++++++++++ templates/tags.templ | 23 ++++++++ 15 files changed, 311 insertions(+), 293 deletions(-) delete mode 100644 internal/builder/404.templ delete mode 100644 internal/builder/homepage.templ delete mode 100644 internal/builder/list.templ delete mode 100644 internal/builder/page.templ delete mode 100644 internal/builder/post.templ delete mode 100644 internal/builder/tags.templ create mode 100644 templates/404.templ create mode 100644 templates/homepage.templ create mode 100644 templates/list.templ create mode 100644 templates/page.templ create mode 100644 templates/post.templ create mode 100644 templates/tags.templ diff --git a/default.nix b/default.nix index 778f790..e3a47f7 100644 --- a/default.nix +++ b/default.nix @@ -72,6 +72,7 @@ rec { ./go.sum ./cmd/build ./internal + ./templates ]; }; modules = ./nix/gomod2nix.toml; @@ -92,6 +93,7 @@ rec { ]; }; } '' + cd $src ${builder}/bin/build -s $src -d $out cp $src/config.toml $out/ ''; @@ -106,6 +108,7 @@ rec { ./go.sum ./cmd/server ./internal + ./templates ]; }; modules = ./nix/gomod2nix.toml; diff --git a/internal/builder/404.templ b/internal/builder/404.templ deleted file mode 100644 index 049e67d..0000000 --- a/internal/builder/404.templ +++ /dev/null @@ -1,13 +0,0 @@ -package builder - -import "website/internal/config" - -templ notFound(config config.Config, path string) { - @page(config, PageSettings{ - Title: "Not Found", - Path: path, - }) { -
- @postDate(post.Date) -
-+ @postDate(post.Date) +
+