diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..439310a --- /dev/null +++ b/templates/header.html @@ -0,0 +1,17 @@ +{{ define "header" }} + +{{ if . }} + +

+ {{ if ne . "" }} + {{ . }} + {{ else }} + Welcome to Micrach + {{ end }} +

+
+{{ else }} +

Welcome to Micrach

+{{ end }} + +{{ end }} diff --git a/templates/index.html b/templates/index.html index 11eb087..6c0f383 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,7 +8,7 @@ -

Welcome to Micrach

+ {{ template "header" }}
{{ template "post-form" .FormData }} diff --git a/templates/thread.html b/templates/thread.html index 153e65e..cd9c2ad 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -11,19 +11,11 @@ - -

- {{ if ne $FirstPost.Title "" }} - {{$FirstPost.Title}} - {{ else }} - Welcome to Micrach - {{ end }} -

-
+ {{ template "header" $FirstPost.Title }}
{{ template "post-form" .FormData }} - +
{{ range $Post := .Thread }}