package pages import ( "strconv" "git.grosinger.net/tgrosinger/saasitone/pkg/page" "git.grosinger.net/tgrosinger/saasitone/pkg/models" "git.grosinger.net/tgrosinger/saasitone/pkg/funcmap" ) templ Home(p page.Page, posts []models.Post) { if (p.HTMX.Request.Target != "posts") { @topContent(p) }
for _, post := range posts {

Gopher

{ post.Title }
{ post.Body }

}
if !p.Pager.IsBeginning() {

} if !p.Pager.IsEnd() {

}
if (p.HTMX.Request.Target != "posts") { @fileMsg() } } templ topContent(p page.Page) {

if p.IsAuth { Hello, { p.AuthUser.Name } } else { Hello }

if p.IsAuth { Welcome back! } else { Please login in to your account. }

Recent posts

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

} templ fileMsg() {

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.
}