aboutsummaryrefslogtreecommitdiff
path: root/template.py
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-07 15:35:48 +0000
committerng0 <ng0@n0.is>2019-11-07 15:35:48 +0000
commitcccc4e317b2851f24ee43f21c3b1517c0b4ea223 (patch)
treef0d52a127caab3b4a574bc9d3b01a8a18110fc28 /template.py
parenta307b7cc7a3e89bbb43d6f73c48155380b537b9c (diff)
downloadwww-cccc4e317b2851f24ee43f21c3b1517c0b4ea223.tar.gz
www-cccc4e317b2851f24ee43f21c3b1517c0b4ea223.zip
truncate news.
Diffstat (limited to 'template.py')
-rwxr-xr-xtemplate.py3
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
172def abstract_news(filename): 173def abstract_news(filename):