diff options
-rw-r--r-- | news/index.html.j2 | 2 | ||||
-rwxr-xr-x | template.py | 3 | ||||
-rw-r--r-- | template/index.html.j2 | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/news/index.html.j2 b/news/index.html.j2 index ee62d49e..814066ec 100644 --- a/news/index.html.j2 +++ b/news/index.html.j2 | |||
@@ -25,7 +25,7 @@ | |||
25 | </p> | 25 | </p> |
26 | </header> | 26 | </header> |
27 | <p class="item-abstract"> | 27 | <p class="item-abstract"> |
28 | {{ item['abstract'] }}...[<a href="{{ item['page'] }}" title="{{ item['date']}}">read more</a>] | 28 | {{ item['abstract'] }} [<a href="{{ item['page'] }}" title="{{ item['date']}}">read more</a>] |
29 | </p> | 29 | </p> |
30 | </section> | 30 | </section> |
31 | </div> | 31 | </div> |
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): |
diff --git a/template/index.html.j2 b/template/index.html.j2 index a6a1b924..86bf86af 100644 --- a/template/index.html.j2 +++ b/template/index.html.j2 | |||
@@ -74,7 +74,7 @@ | |||
74 | </p> | 74 | </p> |
75 | </header> | 75 | </header> |
76 | <p> | 76 | <p> |
77 | {{ item['abstract'] }}... [<a href="news/{{ item['page'] }}">read more</a>] | 77 | {{ item['abstract'] }} [<a href="news/{{ item['page'] }}">read more</a>] |
78 | </p> | 78 | </p> |
79 | </section> | 79 | </section> |
80 | </div> | 80 | </div> |