From 422bcbf82c2fa35a61f79e478ed25ef19a21ec72 Mon Sep 17 00:00:00 2001 From: Nikita Tokarchuk Date: Fri, 3 Dec 2021 04:10:14 +0100 Subject: [PATCH] Add header go html template --- frontend/templates/blog.go.tmpl | 3 +++ frontend/templates/error.go.tmpl | 3 +++ frontend/templates/head.go.tmpl | 7 +++++++ frontend/templates/index.go.tmpl | 3 +++ frontend/templates/templates.go | 1 + 5 files changed, 17 insertions(+) create mode 100644 frontend/templates/head.go.tmpl diff --git a/frontend/templates/blog.go.tmpl b/frontend/templates/blog.go.tmpl index b1ff646..c37e406 100644 --- a/frontend/templates/blog.go.tmpl +++ b/frontend/templates/blog.go.tmpl @@ -1,6 +1,9 @@ + +{{ template "head.go.tmpl" . }} + \ No newline at end of file diff --git a/frontend/templates/error.go.tmpl b/frontend/templates/error.go.tmpl index cfcda8b..a877b06 100644 --- a/frontend/templates/error.go.tmpl +++ b/frontend/templates/error.go.tmpl @@ -1,6 +1,9 @@ + +{{ template "head.go.tmpl" . }} + diff --git a/frontend/templates/head.go.tmpl b/frontend/templates/head.go.tmpl new file mode 100644 index 0000000..10dac4e --- /dev/null +++ b/frontend/templates/head.go.tmpl @@ -0,0 +1,7 @@ + + + + + + {{ .Title }} + \ No newline at end of file diff --git a/frontend/templates/index.go.tmpl b/frontend/templates/index.go.tmpl index b1ff646..c37e406 100644 --- a/frontend/templates/index.go.tmpl +++ b/frontend/templates/index.go.tmpl @@ -1,6 +1,9 @@ + +{{ template "head.go.tmpl" . }} + \ No newline at end of file diff --git a/frontend/templates/templates.go b/frontend/templates/templates.go index 1e6ea78..7379386 100644 --- a/frontend/templates/templates.go +++ b/frontend/templates/templates.go @@ -14,6 +14,7 @@ import ( // Static go-templates source //go:embed blog.go.tmpl //go:embed error.go.tmpl +//go:embed head.go.tmpl //go:embed index.go.tmpl var content embed.FS