aboutsummaryrefslogtreecommitdiffstats
path: root/archive/archive.go
diff options
context:
space:
mode:
Diffstat (limited to 'archive/archive.go')
-rw-r--r--archive/archive.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/archive/archive.go b/archive/archive.go
index 0a6e3c9..60fb89d 100644
--- a/archive/archive.go
+++ b/archive/archive.go
@@ -11,18 +11,18 @@ var archiveTmplName = "archive"
var archiveName = "archive.html"
/*
-ListArchive
+ListArchive
*/
type ListArchive struct {
Posts post.Posts
Tgt string
Template string
-
+
Site interface{}
}
func NewListArchive(posts post.Posts) *ListArchive {
- la := ListArchive{ Posts: posts }
+ la := ListArchive{Posts: posts}
return &la
}
@@ -40,12 +40,17 @@ func (a ListArchive) Render() []byte {
return render.Render(a.Template, a)
}
-
/*
NewRssArchive takes posts and returns an archive ready for RSS output
*/
func NewRssArchive(posts post.Posts) *ListArchive {
- ra := ListArchive{ Posts: posts, Template: "rss" }
+ ra := ListArchive{Posts: posts, Template: "rss"}
ra.Tgt = path.Join(config.Config.HtmlDir, "rss.xml")
return &ra
}
+
+func NewGenericListArchive(posts post.Posts, templateName string, target string) *ListArchive {
+ la := ListArchive{Posts: posts, Template: templateName}
+ la.Tgt = path.Join(config.Config.HtmlDir, target)
+ return &la
+}