initial commit - added base, need to fix templ errors

This commit is contained in:
2025-08-17 10:58:31 +00:00
commit 59d82ae563
20 changed files with 1512 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package templates
import "fmt"
templ Pagination(currentPage, totalPages int) {
<div class="pagination">
if currentPage > 1 {
<a href={ templ.URL(fmt.Sprintf("/?page=%d", currentPage-1)) }
hx-get={ fmt.Sprintf("/?page=%d", currentPage-1) }
hx-target="#post-list"
hx-swap="outerHTML">
<- Previous
</a>
}
<span class="page-info">
Page { fmt.Sprintf("%d", currentPage) }
</span>
if currentPage < totalPages {
<a href={ templ.URL(fmt.Sprintf("/?page=%d", currentPage+1)) }
hx-get={ fmt.Sprintf("/?page=%d", currentPage+1) }
hx-target="#post-list"
hx-swap="outerHTML">
Next ->
</a>
}
</div>
}