changeset 271165794ec6 in www.tryton.org:default
details: https://hg.tryton.org/www.tryton.org?cmd=changeset;node=271165794ec6
description:
Update news description format to Discourse 2.5.0
There is no more a blockquote in the RSS description.
diffstat:
app.py | 6 +++---
templates/index.html | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diffs (28 lines):
diff -r 42e2bc830576 -r 271165794ec6 app.py
--- a/app.py Fri Jun 12 17:43:34 2020 +0200
+++ b/app.py Thu Jun 25 13:32:27 2020 +0200
@@ -328,9 +328,9 @@
yield item
[email protected]_filter('blockquote')
-def blockquote(content):
- block = html.fromstring(str(content)).find('blockquote')
[email protected]_filter('news_text')
+def news_text(content):
+ block = html.fromstring(str(content))
for box in block.find_class('lightbox-wrapper'):
box.drop_tree()
return block.text_content().strip()
diff -r 42e2bc830576 -r 271165794ec6 templates/index.html
--- a/templates/index.html Fri Jun 12 17:43:34 2020 +0200
+++ b/templates/index.html Thu Jun 25 13:32:27 2020 +0200
@@ -253,7 +253,7 @@
<div class="col-md">
<h4>{{ item.title }} <small class="d-none d-sm-inline
text-muted">{{ item.pubDate | string | truncate(16, True, '') }}</small></h4>
<p class="news-description">
- {{ item.description|blockquote|truncate(240) }}
+ {{ item.description|news_text|truncate(240) }}
</p>
<div class="d-flex">
<a class="btn btn-primary ml-auto" href="{{ item.link
}}">More<span class="sr-only">on "{{ item.title }}"</span></a>