From f06192a98a2f8e8dae3148cda59b6b57968160ae Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Tue, 12 Jun 2018 16:59:04 -0700 Subject: remove runtime static file dependencies, use rice boxes --- exporter/exporter.go | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'exporter') diff --git a/exporter/exporter.go b/exporter/exporter.go index 8e7ff12..04ced0b 100644 --- a/exporter/exporter.go +++ b/exporter/exporter.go @@ -1,14 +1,12 @@ package exporter import ( - "adammathes.com/neko/config" "adammathes.com/neko/models/feed" "encoding/json" "encoding/xml" "fmt" "html/template" "os" - "path" ) func ExportFeeds(format string) { @@ -37,9 +35,21 @@ func ExportFeeds(format string) { fmt.Printf("%s\n", js) case "html": - tmplFile := path.Join(config.Config.StaticDir, "feeds.tmpl") - feedsTmpl := template.Must(template.ParseFiles(tmplFile)) - err := feedsTmpl.Execute(os.Stdout, feeds) + htmlTemplateString := ` + +neko exported feeds + + +

neko exported feeds

+ + +` + htmlTemplate, err := template.New("feeds").Parse(htmlTemplateString) + err = htmlTemplate.Execute(os.Stdout, feeds) if err != nil { panic(err) } -- cgit v1.2.3