diff options
| author | Mitchell Riedstra <mitch@x230.my.domain> | 2021-07-11 11:55:47 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@x230.my.domain> | 2021-07-11 11:55:47 -0400 |
| commit | 1c6c1f1597b71f4d4f3a1722655b8864c0d33e6d (patch) | |
| tree | 023701c9d033269d83be8415809b292ae1f3cee0 /cmd/server/handlers.go | |
| parent | e6d53f71c9718ecdb9fde16a924d75a71aadd2d2 (diff) | |
| download | go-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.go | 8 |
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) } |
