gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[www] branch master updated: truncate news.


From: gnunet
Subject: [www] branch master updated: truncate news.
Date: Thu, 07 Nov 2019 16:38:31 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository www.

The following commit(s) were added to refs/heads/master by this push:
     new cccc4e3  truncate news.
cccc4e3 is described below

commit cccc4e317b2851f24ee43f21c3b1517c0b4ea223
Author: ng0 <address@hidden>
AuthorDate: Thu Nov 7 15:35:48 2019 +0000

    truncate news.
---
 news/index.html.j2     | 2 +-
 template.py            | 3 ++-
 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 ee62d49..814066e 100644
--- a/news/index.html.j2
+++ b/news/index.html.j2
@@ -25,7 +25,7 @@
                   </p>
                 </header>
                 <p class="item-abstract">
-                  {{ item['abstract'] }}...[<a href="{{ item['page'] }}" 
title="{{ item['date']}}">read more</a>]
+                  {{ item['abstract'] }} [<a href="{{ item['page'] }}" 
title="{{ item['date']}}">read more</a>]
                 </p>
               </section>
             </div>
diff --git a/template.py b/template.py
index cee18af..9fe859f 100755
--- a/template.py
+++ b/template.py
@@ -166,7 +166,8 @@ def preview_text(filename):
             k.append(i)
         b = ''.join(str(e) for e in k)
         text = b.replace("\n", "")
-        return(text)
+        textreduced = (text[:300] + '...') if len(text) > 300 else (text + 
'..')
+        return(textreduced)
 
 
 def abstract_news(filename):
diff --git a/template/index.html.j2 b/template/index.html.j2
index a6a1b92..86bf86a 100644
--- a/template/index.html.j2
+++ b/template/index.html.j2
@@ -74,7 +74,7 @@
               </p>
             </header>
             <p>
-              {{ item['abstract'] }}... [<a href="news/{{ item['page'] 
}}">read more</a>]
+              {{ item['abstract'] }} [<a href="news/{{ item['page'] }}">read 
more</a>]
             </p>
           </section>
         </div>

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]