This repository has been archived on 2025-03-01. You can view files and clone it, but cannot push or open issues or pull requests.
trantor/templates/search.rss
2017-05-21 10:47:00 +00:00

33 lines
771 B
XML

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
{{with .S}}
<title>{{.Title}}</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 .Authors 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 .Authors}}
{{if .}}
<category>{{.}}</category>
{{end}}
{{end}}
</item>
{{end}}
</channel>
</rss>