diff options
Diffstat (limited to 'theme')
-rw-r--r-- | theme/templates/abstract.html | 19 | ||||
-rwxr-xr-x | theme/templates/category.html | 11 | ||||
-rwxr-xr-x | theme/templates/index.html | 28 | ||||
-rwxr-xr-x | theme/templates/tag.html | 15 |
4 files changed, 34 insertions, 39 deletions
diff --git a/theme/templates/abstract.html b/theme/templates/abstract.html new file mode 100644 index 0000000..57ff2ab --- /dev/null +++ b/theme/templates/abstract.html @@ -0,0 +1,19 @@ +{% macro abstract(article, title_level) %} + <article class="post"> + <{{title_level}} class="title"><a href="{{ SITEURL }}/{{ article.url}}">{{article.title }}</a></{{title_level}}> + + + <time class="meta" datetime="{{ article.date.isoformat() }}" pubdate="pubdate">{{ article.locale_date }}</time> + <section class="post_content"> + + {% if article.logo %} + <div class="floatleft figure" style="width: 75px"> + <img src="{{ SITEURL }}/{{article.logo}}" > + </div> + {% endif %} + + {{ article.summary }} + <div class="clear" /> + </section> + </article> +{% endmacro %} diff --git a/theme/templates/category.html b/theme/templates/category.html index a541a1c..f3588eb 100755 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -5,18 +5,11 @@ <h1 class="page_title">Articles dans la catégorie « {{ category }} »</h1> {% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} - <article class="post"> - <h2 class="title"><a href="{{ SITEURL }}/{{ article.url}}">{{ article.title }}</a></h2> - <time class="meta" datetime="{{ article.date.isoformat() }}" pubdate="pubdate">{{ article.locale_date }}</time> - - <section class="post_content"> - {{ article.summary }} - <div class="clear" /> + {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h2") }} {% if not loop.last %} <hr> {% endif %} - </section> - </article> {% endfor %} {% endif %} {% include 'navigator.html' %} diff --git a/theme/templates/index.html b/theme/templates/index.html index bf288a8..a54ae31 100755 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -4,26 +4,14 @@ {% block content %} {% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} - <article class="post"> - <h1 class="title"><a href="{{ SITEURL }}/{{ article.url}}">{{ article.title }}</a></h1> - - - <time class="meta" datetime="{{ article.date.isoformat() }}" pubdate="pubdate">{{ article.locale_date }}</time> - <section class="post_content"> - - {% if article.logo %} - <div class="floatleft figure" style="width: 75px"> - <img src="{{article.logo}}" > - </div> - {% endif %} - - {{ article.summary }} - <div class="clear" /> - {% if not loop.last %} - <hr> - {% endif %} - </section> - </article> + + {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h1") }} + + {% if not loop.last %} + <hr> + {% endif %} + {% endfor %} {% include 'navigator.html' %} diff --git a/theme/templates/tag.html b/theme/templates/tag.html index 059442a..101a22d 100755 --- a/theme/templates/tag.html +++ b/theme/templates/tag.html @@ -5,18 +5,13 @@ <h1 class="page_title">Articles avec le mot-clef « {{ tag }} »</h1> {% if articles %} {% for article in (articles_page.object_list if articles_page else articles) %} - <article class="post"> - <h2 class="title"><a href="{{ SITEURL }}/{{ article.url}}">{{ article.title }}</a></h2> -<time class="meta" datetime="{{ article.date.isoformat() }}" pubdate="pubdate">{{ article.locale_date }}</time> + {% import 'abstract.html' as abstract with context %} + {{ abstract.abstract(article, "h2") }} - <section class="post_content"> - {{ article.summary }} - <div class="clear" /> - {% if not loop.last %} + {% if not loop.last %} <hr> - {% endif %} - </section> - </article> + {% endif %} + {% endfor %} {% endif %} {% include 'navigator.html' %} |