diff options
author | ng0 <ng0@n0.is> | 2019-11-07 15:35:48 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-07 15:35:48 +0000 |
commit | cccc4e317b2851f24ee43f21c3b1517c0b4ea223 (patch) | |
tree | f0d52a127caab3b4a574bc9d3b01a8a18110fc28 /template.py | |
parent | a307b7cc7a3e89bbb43d6f73c48155380b537b9c (diff) | |
download | www-cccc4e317b2851f24ee43f21c3b1517c0b4ea223.tar.gz www-cccc4e317b2851f24ee43f21c3b1517c0b4ea223.zip |
truncate news.
Diffstat (limited to 'template.py')
-rwxr-xr-x | template.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/template.py b/template.py index cee18aff..9fe859fd 100755 --- a/template.py +++ b/template.py | |||
@@ -166,7 +166,8 @@ def preview_text(filename): | |||
166 | k.append(i) | 166 | k.append(i) |
167 | b = ''.join(str(e) for e in k) | 167 | b = ''.join(str(e) for e in k) |
168 | text = b.replace("\n", "") | 168 | text = b.replace("\n", "") |
169 | return(text) | 169 | textreduced = (text[:300] + '...') if len(text) > 300 else (text + '..') |
170 | return(textreduced) | ||
170 | 171 | ||
171 | 172 | ||
172 | def abstract_news(filename): | 173 | def abstract_news(filename): |