From 06d17d98b34c6daf786aa808f73e6f4692d50da0 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Mon, 10 Apr 2017 18:47:41 -0700 Subject: tag wip --- site/site.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'site') diff --git a/site/site.go b/site/site.go index a897f4e..f897171 100644 --- a/site/site.go +++ b/site/site.go @@ -23,6 +23,7 @@ type Site struct { Home *archive.ListArchive Rss *archive.ListArchive Paged *archive.PagedArchives + Tagged *archive.TagArchives } /* @@ -45,6 +46,10 @@ func (s *Site) Read() { if render.TmplExists("paged") { s.Paged = archive.CreatePaged(15, s.Posts) } + if render.TmplExists("tag") { + s.Tagged = archive.ParseTags(s.Posts) + log.Printf("%v\n", s.Tagged) + } if render.TmplExists("home") { s.Home = archive.NewListArchive(s.Posts) s.Home.Tgt = path.Join(config.Config.HtmlDir, "index.html") @@ -126,6 +131,13 @@ func (s *Site) WriteArchives() { render.Write(p) } } + if render.TmplExists("tag") { + for _, t := range *s.Tagged { + log.Printf("%s\n%v\n\n", t.Tag, t.Posts) + t.Site = s + render.Write(t) + } + } } func (s *Site) WritePosts() { -- cgit v1.2.3