From db6d1cab0ac603c98c5bb0ae42e7daef8e6e380b Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sat, 18 May 2024 22:37:30 -0700 Subject: [PATCH] broke out the layout to multiple files --- internal/views/layout/error.templ | 8 +++ internal/views/layout/footer.templ | 15 ++++++ internal/views/layout/header.templ | 12 +++++ internal/views/layout/navbar.templ | 60 +++++++++++++++++++++ internal/views/layout/withTemplate.templ | 69 ++---------------------- 5 files changed, 98 insertions(+), 66 deletions(-) create mode 100644 internal/views/layout/error.templ create mode 100644 internal/views/layout/footer.templ create mode 100644 internal/views/layout/header.templ create mode 100644 internal/views/layout/navbar.templ diff --git a/internal/views/layout/error.templ b/internal/views/layout/error.templ new file mode 100644 index 0000000..e1b00d6 --- /dev/null +++ b/internal/views/layout/error.templ @@ -0,0 +1,8 @@ +package layout + +templ Error(err error) { + @WithTemplate() { +

Error

+

{ err.Error() }

+ } +} diff --git a/internal/views/layout/footer.templ b/internal/views/layout/footer.templ new file mode 100644 index 0000000..167ff62 --- /dev/null +++ b/internal/views/layout/footer.templ @@ -0,0 +1,15 @@ +package layout + +templ footer() { + +} \ No newline at end of file diff --git a/internal/views/layout/header.templ b/internal/views/layout/header.templ new file mode 100644 index 0000000..f7e5976 --- /dev/null +++ b/internal/views/layout/header.templ @@ -0,0 +1,12 @@ +package layout + +templ header() { + + + + + + + + +} \ No newline at end of file diff --git a/internal/views/layout/navbar.templ b/internal/views/layout/navbar.templ new file mode 100644 index 0000000..1c071aa --- /dev/null +++ b/internal/views/layout/navbar.templ @@ -0,0 +1,60 @@ +package layout + +templ navBar() { + +} diff --git a/internal/views/layout/withTemplate.templ b/internal/views/layout/withTemplate.templ index 23abbc4..4a6c2d6 100644 --- a/internal/views/layout/withTemplate.templ +++ b/internal/views/layout/withTemplate.templ @@ -4,77 +4,14 @@ templ WithTemplate() { - - - - - - - - + @header() - + @navBar()
{ children... }
+ @footer() }