diff --git a/templates/pages/home.gohtml b/templates/pages/home.gohtml index ba777c3..9490ad8 100644 --- a/templates/pages/home.gohtml +++ b/templates/pages/home.gohtml @@ -1,17 +1,25 @@ {{define "content"}} {{- if not (eq .HTMX.Request.Target "posts")}} - Hello homepage -

Gopher

- -
-

Recent posts

-

- Below is an example of both paging and AJAX fetching using HTMX -

-
+ {{template "top-content" .}} {{- end}} {{template "posts" .}} + + {{- if not (eq .HTMX.Request.Target "posts")}} + {{template "file-msg" .}} + {{- end}} +{{end}} + +{{define "top-content"}} + Hello homepage +

Gopher

+ +
+

Recent posts

+

+ Below is an example of both paging and AJAX fetching using HTMX +

+
{{end}} {{define "posts"}} @@ -48,4 +56,18 @@ {{- end}} +{{end}} + +{{define "file-msg"}} +
+
+

Serving files

+ +
+
+ In the example posts above, check how the file URL contains a cache-buster query parameter which changes only when the app is restarted. + Static files also contain cache-control headers which are configured via middleware. + You can also use AlpineJS to dismiss this message. +
+
{{end}} \ No newline at end of file