Mercurial > libervia-templates
diff sat_templates/default/blog/atom.xml @ 147:33c7ce833d3f
install: setup.py fix + moved "default" dir in a "sat_templates" dir:
the merge request at https://bugs.goffi.org/mr/view/3 was a good basis, but not fully working ("default" dir was removed), this patch fixes it, and do some improvments:
- moved "default" in "sat_templates" dir, which correspond to the python module, so it can be found easily from python
- added VERSION, and mercurial hash detection, in the same way as for Cagou and backend
- slight modification of classifiers
- replaces tabs coming from MR by spaces
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 02 Jun 2018 17:25:43 +0200 |
parents | default/blog/atom.xml@81f4ba3b121b |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sat_templates/default/blog/atom.xml Sat Jun 02 17:25:43 2018 +0200 @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns='http://www.w3.org/2005/Atom'> + {% if title is defined %} + <title>{{title}}</title> + {% elif target_profile is defined %} + <title>{% trans name=target_profile%}{{name}}'s blog{% endtrans %}</title> + {% else %} + <title>{% trans app_name=C.APP_NAME%}{{app_name}} blog{% endtrans %}</title> + {% endif %} + <link href='{{request_uri}}' type='application/atom+xml' rel='self'/> + <link href='{{http_uri}}' type='text/html' rel='alternate'/> + <link href='{{xmpp_uri}}' type='application/atom+xml' rel='alternate'/> + <id>{{xmpp_uri}}</id> + <updated>{{updated|date_fmt('iso')}}</updated> + {% for item in items %} + <entry> + {% if item.title_xhtml %} + <title type='xhtml'>{{item.title_xhtml}}</title> + {% else %} + <title>{{item.title|default(item.content|truncate(80, True, '…'), True)}}</title> + {% endif %} + <link href='{{items_http_uri[item.id]}}' type='text/html' rel='alternate'/> + <link href='{{item.uri}}' type='application/atom+xml' rel='alternate'/> + <id>{{item.uri}}</id> + <updated>{{item.updated|date_fmt('iso')}}</updated> + <published>{{item.published|date_fmt('iso')}}</published> + <author> + <name>{{item.author}}</name> + <uri>xmpp:{{item.author_jid}}</uri> + </author> + {% for tag in item.tags %} + <category term="{{tag}}"/> + {% endfor %} + {% if item.content_xhtml %} + <content type='xhtml'> + <div xmlns='http://www.w3.org/1999/xhtml'> + {{item.content_xhtml}} + </div> + </content> + {% else %} + <content type='text'> + {{item.content_txt}} + </content> + {% endif %} + </entry> + {% endfor %} +</feed>