From ca65436fb64ea517f88f47f42ac8a5c0dea71108 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Sun, 5 Sep 2021 14:36:10 +0300 Subject: [PATCH] feat: add nested templates --- templates/index.html | 22 +++------------------ templates/templates.html | 41 ++++++++++++++++++++++++++++++++++++++++ templates/thread.html | 40 ++------------------------------------- 3 files changed, 46 insertions(+), 57 deletions(-) create mode 100644 templates/templates.html diff --git a/templates/index.html b/templates/index.html index b715673..95db773 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,26 +1,10 @@ - + {{ template "static" }} + Micrach - - - - - - + diff --git a/templates/templates.html b/templates/templates.html new file mode 100644 index 0000000..c2ba6f1 --- /dev/null +++ b/templates/templates.html @@ -0,0 +1,41 @@ +{{ define "static" }} + + + + +{{ end }} + +{{ define "meta" }} + {{ .Title }} + + + + + + + + + + + + + + + + + + + +{{ end }} \ No newline at end of file diff --git a/templates/thread.html b/templates/thread.html index 8dd00a1..fab475d 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -2,44 +2,8 @@ - - {{$FirstPost.Title}} - - - - - - - - - - - - - - - - - - - - - - - - + {{ template "static" }} + {{ template "meta" $FirstPost }}