aboutsummaryrefslogtreecommitdiff
path: root/cmd/server/handlers.go
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@x230.my.domain>2021-07-11 11:55:47 -0400
committerMitchell Riedstra <mitch@x230.my.domain>2021-07-11 11:55:47 -0400
commit1c6c1f1597b71f4d4f3a1722655b8864c0d33e6d (patch)
tree023701c9d033269d83be8415809b292ae1f3cee0 /cmd/server/handlers.go
parente6d53f71c9718ecdb9fde16a924d75a71aadd2d2 (diff)
downloadgo-website-1c6c1f1597b71f4d4f3a1722655b8864c0d33e6d.tar.gz
go-website-1c6c1f1597b71f4d4f3a1722655b8864c0d33e6d.tar.xz
Initial banging away at adding an Atom feed to the site
Diffstat (limited to 'cmd/server/handlers.go')
-rw-r--r--cmd/server/handlers.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/server/handlers.go b/cmd/server/handlers.go
index 60e0a35..02fb712 100644
--- a/cmd/server/handlers.go
+++ b/cmd/server/handlers.go
@@ -11,6 +11,13 @@ import (
type App struct {
ReIndexPath string
StaticDirectory string
+
+ // Related to the Atom feed
+ Title string
+ Description string // aka, "subtitle"
+ Author Author
+ FeedId string
+ Updated page.PageTime
}
func (a *App) PageHandler(w http.ResponseWriter, r *http.Request) {
@@ -48,6 +55,7 @@ func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) {
rtr := mux.NewRouter()
rtr.HandleFunc(a.ReIndexPath, a.RebuildIndexHandler)
rtr.PathPrefix("/static/").Handler(a.StaticHandler())
+ rtr.PathPrefix("/.feeds/{tag}").HandlerFunc(a.FeedHandler)
rtr.PathPrefix("/").HandlerFunc(a.PageHandler)
rtr.ServeHTTP(w, r)
}