Add rss feed for the news
This commit is contained in:
parent
0f81282ad9
commit
eb8acc8a5b
4 changed files with 39 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<h4>News:</h4>
|
||||
<h4>News:
|
||||
<a href="/news/?fmt=rss" class="pull-right"><img src="/img/feed.png"/></a>
|
||||
</h4>
|
||||
|
||||
<dl class="dl-horizontal">
|
||||
{{range .News}}
|
||||
|
|
20
templates/news_rss.xml
Normal file
20
templates/news_rss.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0">
|
||||
<channel>
|
||||
{{with .S}}
|
||||
<title>Imperial Library of Trantor - News</title>
|
||||
<description>News of the library</description>
|
||||
<link>{{.BaseURL}}/news/</link>
|
||||
{{end}}
|
||||
|
||||
{{$baseURL := .S.BaseURL}}
|
||||
{{range .News}}
|
||||
<item>
|
||||
<title>{{.Date}}</title>
|
||||
<description>{{.Text}}</description>
|
||||
<link>{{$baseURL}}/news/</link>
|
||||
</item>
|
||||
{{end}}
|
||||
|
||||
</channel>
|
||||
</rss>
|
Reference in a new issue