flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 9a9f03b54e5ebfac79fdece518d95fbf395d29af
parent d600ed485ac53c042d93fab1ec3fdc5249f183cc
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 24 Oct 2021 14:32:24 -0700

update finger to add updated time

Diffstat:
Mfinger.go | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/finger.go b/finger.go @@ -23,11 +23,19 @@ func runFingerServer() { w.Write([]byte("Not found\n")) return } + i, err := os.Stat(fullPath) + if err != nil { + w.Write([]byte("Error\n")) + return + } _, err = io.Copy(w, f) if err != nil { w.Write([]byte("Error\n")) return } + updatedString := i.ModTime().Format("2006-01") + w.Write([]byte("\n---\nUpdated: ")) + w.Write([]byte(updatedString)) }), Addr: ":7979", ReadTimeout: 5 * time.Minute,