diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-09-10 11:48:03 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-09-10 11:48:03 -0400 |
| commit | 3c58ef00f8ab770f4e278e1dae6e486dfa050e78 (patch) | |
| tree | 8cb65b699dee5cf495322d67ee04eab00916985c /xesite/main.go | |
| parent | 8eb7eaf80084346f07dc573a641b077a000982f1 (diff) | |
| download | xesite-go.tar.xz xesite-go.zip | |
use base link colors in tailwindgo
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'xesite/main.go')
| -rw-r--r-- | xesite/main.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xesite/main.go b/xesite/main.go index ef530e9..ca800d9 100644 --- a/xesite/main.go +++ b/xesite/main.go @@ -11,6 +11,7 @@ import ( "sync" "time" + "tailscale.com/tsweb" "xeiaso.net/v4" "xeiaso.net/v4/config" "xeiaso.net/v4/internal" @@ -89,7 +90,9 @@ func main() { var talks []*internal.Post var gallery []*internal.Post - for _, post := range posts { + postsIndex := map[string]int{} + + for i, post := range posts { switch strings.Split(post.Link, "/")[0] { case "blog": blog = append(blog, post) @@ -98,6 +101,8 @@ func main() { case "gallery": gallery = append(gallery, post) } + + postsIndex[post.Link] = i } mux.Handle("/static/", http.FileServer(http.FS(xeiaso.Static))) @@ -136,6 +141,8 @@ func main() { mux.HandleFunc("/", site.Index) mux.HandleFunc("/blog", site.BlogIndex) + mux.HandleFunc("/metrics", tsweb.VarzHandler) + slog.Info("listening", "addr", *addr) log.Fatal(http.ListenAndServe(*addr, mux)) |
