simplified some loops, added day2.md to test new footer date functionality

This commit is contained in:
2026-03-10 23:59:17 +00:00
parent 18d151e0cf
commit 4ef81c59bf
8 changed files with 83 additions and 23 deletions

View File

@@ -1,11 +1,21 @@
package templates
templ Footer() {
import "time"
func FormatLastUpdated(t time.Time) string {
updatedAt := "Now-ish"
if !t.IsZero() {
updatedAt = t.Format("January 2, 2006")
}
return updatedAt
}
templ Footer(lastUpdated time.Time) {
<footer class="footer">
<p>
© 2025 Valentine Bott | Built with Go + Templ + HTMX |
© 2026 Valentine Bott | Built with Go + Templ + HTMX |
<a href="https://git.valxntine.dev/valxntine/blog">Source Code</a> |
Last updated: <span class="blink">●</span> Now-ish
Last updated: <span class="blink">●</span> { FormatLastUpdated(lastUpdated) }
</p>
</footer>
}