aboutsummaryrefslogtreecommitdiff
path: root/cmd/site/main.go
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2019-09-12 18:49:03 -0400
committerGitHub <noreply@github.com>2019-09-12 18:49:03 -0400
commit7a302eb69bfef1ecd0a17e16085bd4359a0ae717 (patch)
treefc6d777b3c4f2af57951f0921de8a334ad4cfee8 /cmd/site/main.go
parent2007492c492be3c32b19fbfcc6b6c1a5cc5ef0e0 (diff)
downloadxesite-7a302eb69bfef1ecd0a17e16085bd4359a0ae717.tar.xz
xesite-7a302eb69bfef1ecd0a17e16085bd4359a0ae717.zip
Series and tags (#74)
* initial support for tags and series * tagging support * oops * Update main.go
Diffstat (limited to 'cmd/site/main.go')
-rw-r--r--cmd/site/main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/site/main.go b/cmd/site/main.go
index 04d8bc4..391b56b 100644
--- a/cmd/site/main.go
+++ b/cmd/site/main.go
@@ -58,6 +58,7 @@ type Site struct {
Posts blog.Posts
Talks blog.Posts
Resume template.HTML
+ Series []string
rssFeed *feeds.Feed
jsonFeed *jsonfeed.Feed
@@ -81,7 +82,7 @@ func (s *Site) ServeHTTP(w http.ResponseWriter, r *http.Request) {
middleware.RequestID(s.xffmw.Handler(ex.HTTPLog(s.mux))).ServeHTTP(w, r)
}
-var arbDate = time.Date(2019, time.May, 20, 18, 0, 0, 0, time.UTC)
+var arbDate = time.Date(2019, time.September, 12, 0, 0, 0, 0, time.UTC)
// Build creates a new Site instance or fails.
func Build() (*Site, error) {
@@ -147,6 +148,8 @@ func Build() (*Site, error) {
return nil, err
}
s.Posts = posts
+ s.Series = posts.Series()
+ sort.Strings(s.Series)
talks, err := blog.LoadPosts("./talks", "talks")
if err != nil {
@@ -210,6 +213,8 @@ func Build() (*Site, error) {
s.mux.Handle("/blog.atom", middleware.Metrics("blog.atom", http.HandlerFunc(s.createAtom)))
s.mux.Handle("/blog.json", middleware.Metrics("blog.json", http.HandlerFunc(s.createJSONFeed)))
s.mux.Handle("/blog/", middleware.Metrics("blogpost", http.HandlerFunc(s.showPost)))
+ s.mux.Handle("/blog/series", http.HandlerFunc(s.listSeries))
+ s.mux.Handle("/blog/series/", http.HandlerFunc(s.showSeries))
s.mux.Handle("/talks/", middleware.Metrics("talks", http.HandlerFunc(s.showTalk)))
s.mux.Handle("/css/", http.FileServer(http.Dir(".")))
s.mux.Handle("/static/", http.FileServer(http.Dir(".")))