aboutsummaryrefslogtreecommitdiffstats
path: root/site
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-04-10 18:47:41 -0700
committerAdam Mathes <adam@trenchant.org>2017-04-10 18:47:41 -0700
commit06d17d98b34c6daf786aa808f73e6f4692d50da0 (patch)
tree4c891512b24cb3a686cdbcd3e0f412d439eded32 /site
parent0bde21f3da1152eeaea0a8f712f7244b26d5df02 (diff)
downloadsnkt-06d17d98b34c6daf786aa808f73e6f4692d50da0.tar.gz
snkt-06d17d98b34c6daf786aa808f73e6f4692d50da0.tar.bz2
snkt-06d17d98b34c6daf786aa808f73e6f4692d50da0.zip
tag wip
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() {