aboutsummaryrefslogtreecommitdiffstats
path: root/site
diff options
context:
space:
mode:
Diffstat (limited to 'site')
-rw-r--r--site/site.go12
1 files changed, 12 insertions, 0 deletions
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() {