From 22e881fa89e4b3b8f6207d2c2e8713c2ff919400 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Wed, 8 May 2013 10:54:59 +0200 Subject: Added articlelogo on main page --- content/Informatique/gueule1.rst | 1 + content/Informatique/guiderstodt.rst | 2 ++ content/images/gedit.png | Bin 0 -> 5362 bytes content/images/rstodt/writing_75.jpg | Bin 0 -> 4238 bytes pelicanconf.py | 3 ++- theme/templates/article.html | 4 ++++ theme/templates/index.html | 24 ++++++++++++++++-------- theme/templates/menu.html | 2 +- theme/templates/translations.html | 10 ++++++++++ 9 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 content/images/gedit.png create mode 100644 content/images/rstodt/writing_75.jpg create mode 100644 theme/templates/translations.html diff --git a/content/Informatique/gueule1.rst b/content/Informatique/gueule1.rst index 7d060a0..8832e66 100644 --- a/content/Informatique/gueule1.rst +++ b/content/Informatique/gueule1.rst @@ -6,6 +6,7 @@ Essai raté d'un plugin gedit :date: 20/04/2013 :tags: Programmation, Libre, Humeur +:logo: static/images/gedit.png En relisant mes articles, j'ai décidé d'utiliser languageTool_ pour vérifier la grammaire avant de les publier. Puis en regardant l'outil, j'ai voulu voir s'il diff --git a/content/Informatique/guiderstodt.rst b/content/Informatique/guiderstodt.rst index fc14a0a..d4105a3 100644 --- a/content/Informatique/guiderstodt.rst +++ b/content/Informatique/guiderstodt.rst @@ -7,6 +7,8 @@ Guide d'utilisation de rst2odt :date: 2013-05-07 :tags: Libre, reStructuredText :summary: |summary| +:logo: static/images/rstodt/writing_75.jpg + .. figure:: |filename|/images/rstodt/writing.jpg :figwidth: 150 diff --git a/content/images/gedit.png b/content/images/gedit.png new file mode 100644 index 0000000..116e8df Binary files /dev/null and b/content/images/gedit.png differ diff --git a/content/images/rstodt/writing_75.jpg b/content/images/rstodt/writing_75.jpg new file mode 100644 index 0000000..73abc64 Binary files /dev/null and b/content/images/rstodt/writing_75.jpg differ diff --git a/pelicanconf.py b/pelicanconf.py index 6edae01..cd38cc3 100755 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -19,7 +19,6 @@ DEFAULT_LANG = u'fr' #SOCIAL = (('You can add links in your config file', '#'), # ('Another social link', '#'),) -DEFAULT_PAGINATION = 4 FEED_DOMAIN = SITEURL FEED_RSS = 'feed' FEED_ATOM = 'feeds/atom.xml' @@ -27,6 +26,8 @@ FEED_MAX_ITEMS=5 TAG_FEED_RSS = 'feeds/%s.xml' TAG_FEED_ATOM = 'feeds/%s.atom' +DEFAULT_PAGINATION = FEED_MAX_ITEMS + ARTICLE_URL = u'{date:%Y}/{date:%m}/{slug}/' ARTICLE_SAVE_AS = u'{date:%Y}/{date:%m}/{slug}/index.html' diff --git a/theme/templates/article.html b/theme/templates/article.html index b53962d..a23074c 100755 --- a/theme/templates/article.html +++ b/theme/templates/article.html @@ -6,6 +6,9 @@

{{ article.title }}

{%include 'meta.html'%} + {% import 'translations.html' as translations with context %} + {{ translations.translations_for(article) }} +
{{ article.content }} @@ -14,6 +17,7 @@
{% if article.related_posts and article.related_posts %} +

À lire aussi :

diff --git a/theme/templates/index.html b/theme/templates/index.html index d045910..bf288a8 100755 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -6,14 +6,22 @@ {% for article in (articles_page.object_list if articles_page else articles) %}

{{ article.title }}

- - -
- {{ article.summary }} -
- {% if not loop.last %} -
- {% endif %} + + + +
+ + {% if article.logo %} +
+ +
+ {% endif %} + + {{ article.summary }} +
+ {% if not loop.last %} +
+ {% endif %}
{% endfor %} diff --git a/theme/templates/menu.html b/theme/templates/menu.html index bab98fa..6cc3636 100755 --- a/theme/templates/menu.html +++ b/theme/templates/menu.html @@ -15,7 +15,7 @@
  • Articles
      {% for article in articles %} - {% if loop.index < FEED_MAX_ITEMS %} + {% if loop.index <= FEED_MAX_ITEMS %}
    • {{ article.title }}
    • {% endif %} {% endfor %} diff --git a/theme/templates/translations.html b/theme/templates/translations.html new file mode 100644 index 0000000..121ff1a --- /dev/null +++ b/theme/templates/translations.html @@ -0,0 +1,10 @@ +{% macro translations_for(article) %} +{% if article.translations %} +
      +Traductions : +{% for translation in article.translations %} +{{ translation.lang }} +{% endfor %} +
      +{% endif %} +{% endmacro %} -- cgit v1.2.3