Refactor templates to make take care of fmt

This commit is contained in:
Las Zenow 2014-08-30 01:25:16 -05:00
parent e81df155a2
commit c132c0fdf6
11 changed files with 51 additions and 59 deletions

33
templates/search.rss Normal file
View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
{{with .S}}
<title>Imperial Library of Trantor</title>
{{if .Search}}
<description>Book search: {{.Search}}</description>
{{else}}
<description>Last books added</description>
{{end}}
<link>{{.BaseURL}}</link>
{{end}}
{{$baseURL := .S.BaseURL}}
{{range .Books}}
<item>
<title>{{.Title}} - {{index .Author 0}}</title>
<description>{{.Description}}</description>
<link>{{$baseURL}}/book/{{.Id}}</link>
{{if .Isbn}}
<guid isPermaLink="false">ISBN: {{.Isbn}}</guid>
{{end}}
<enclosure url="{{$baseURL}}/download/{{.Id}}/{{.Title}}.epub" length="{{.FileSize}}" type="application/epub+zip" />
{{range .Subject}}
{{if .}}
<category>{{.}}</category>
{{end}}
{{end}}
</item>
{{end}}
</channel>
</rss>