Refactor templates to make take care of fmt
This commit is contained in:
parent
e81df155a2
commit
c132c0fdf6
11 changed files with 51 additions and 59 deletions
33
templates/search.rss
Normal file
33
templates/search.rss
Normal 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>
|
Reference in a new issue