index.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {% extends "base.html" %}
  2. {% block content %}
  3. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.index_top %}
  4. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  5. <ins class="adsbygoogle ads-responsive"
  6. data-ad-client="{{ GOOGLE_ADSENSE.ca_id }}"
  7. data-ad-slot="{{ GOOGLE_ADSENSE.ads.index_top }}"></ins>
  8. <script>
  9. (adsbygoogle = window.adsbygoogle || []).push({});
  10. </script>
  11. {% endif %}
  12. {% for article in articles_page.object_list %}
  13. <article>
  14. <header>
  15. <h2><a href="{{ SITEURL }}/{{ article.url }}{% if not DISABLE_URL_HASH %}#{{ article.slug }}{% endif %}">{{ article.title }}</a></h2>
  16. <p>
  17. {{ _('Posted on %(when)s in %(category)s',
  18. when=article.locale_date,
  19. category='<a href="%s/%s">%s</a>'|format(SITEURL, article.category.url, article.category)|safe) }}
  20. {% if article.tags and not HOME_HIDE_TAGS %}
  21. &#8226; {{ _('Tagged with') }}
  22. {% for tag in article.tags %}
  23. <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %},{% endif %}
  24. {% endfor %}
  25. {% endif %}
  26. {% if 'post_stats' in PLUGINS %}
  27. &#8226; {{ article.stats['read_mins'] }} min read
  28. {% endif %}
  29. </p>
  30. </header>
  31. <div>
  32. {% if summarise or article.metadata['summary'] or SUMMARY_MAX_LENGTH %}
  33. {% if article.featured_image %}
  34. <img src="{{ article.featured_image }}">
  35. {% endif %}
  36. {{ article.summary }}
  37. <br>
  38. <a class="btn" href="{{ SITEURL }}/{{ article.url }}{% if not DISABLE_URL_HASH %}#{{ article.slug }}{% endif %}">{{ _('Continue reading') }}</a>
  39. {% else %}
  40. {{ article.content }}
  41. {% endif %}
  42. </div>
  43. {% if not loop.last %}
  44. <hr />
  45. {% endif %}
  46. </article>
  47. {% endfor %}
  48. {% include "partial/pagination.html" %}
  49. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.index_bottom %}
  50. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  51. <ins class="adsbygoogle ads-responsive"
  52. data-ad-client="{{ GOOGLE_ADSENSE.ca_id }}"
  53. data-ad-slot="{{ GOOGLE_ADSENSE.ads.index_bottom }}"></ins>
  54. <script>
  55. (adsbygoogle = window.adsbygoogle || []).push({});
  56. </script>
  57. {% endif %}
  58. {% endblock %}