simplified some loops, added day2.md to test new footer date functionality
This commit is contained in:
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user