{{.Title}}
{{.Body}}
{{define "content"}}
{{- if not (eq .HTMX.Request.Target "posts")}}
{{template "top-content" .}}
{{- end}}
{{template "posts" .}}
{{- if not (eq .HTMX.Request.Target "posts")}}
{{template "file-msg" .}}
{{- end}}
{{end}}
{{define "top-content"}}
Hello{{if .IsAuth}}, {{.AuthUser.Name}}{{end}}
{{if .IsAuth}}Welcome back!{{else}}Please login in to your account.{{end}}
Recent posts
Below is an example of both paging and AJAX fetching using HTMX
{{.Title}}
{{.Body}}
{{- end}} {{- if not $.Pager.IsEnd}}
{{- end}}