article.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {% extends "base.html" %}
  2. {% block meta %}
  3. <meta name="author" content="{{ article.author.name }}" />
  4. <meta name="description" content="{{ article.summary|striptags|escape }}" />
  5. <meta name="keywords" content="{{ article.tags|join(', ')|escape }}">
  6. {% include "partial/og_article.html" %}
  7. {% endblock %}
  8. {% block title %} &ndash; {{ article.title|striptags|escape }}{% endblock %}
  9. {% block content %}
  10. <article class="single">
  11. <header>
  12. {% if not ARTICLE_HIDE_TRANSLATION %}
  13. {% import 'partial/translations.html' as translations with context %}
  14. {{ translations.translations_for(article) }}
  15. {% endif %}
  16. <h1 id="{{ article.slug }}">{{ article.title }}</h1>
  17. <p>
  18. {{ _('Posted on %(when)s in %(category)s',
  19. when=article.locale_date,
  20. category='<a href="%s/%s">%s</a>'|format(SITEURL, article.category.url, article.category)|safe) }}
  21. {% if 'post_stats' in PLUGINS %}
  22. &#8226; {{ article.stats['read_mins'] }} min read
  23. {% endif %}
  24. </p>
  25. </header>
  26. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.article_top %}
  27. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  28. <ins class="adsbygoogle ads-responsive"
  29. data-ad-client="{{ GOOGLE_ADSENSE.ca_id }}"
  30. data-ad-slot="{{ GOOGLE_ADSENSE.ads.article_top }}"></ins>
  31. <script>
  32. (adsbygoogle = window.adsbygoogle || []).push({});
  33. </script>
  34. {% endif %}
  35. <div>
  36. {{ article.content }}
  37. </div>
  38. <div class="tag-cloud">
  39. <p>
  40. {% if article.tags %}
  41. {% for tag in article.tags %}
  42. <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
  43. {% endfor %}
  44. {% endif %}
  45. </p>
  46. </div>
  47. {% if ADD_THIS_ID %}
  48. <div class="center social-share">
  49. <p>{{ _('Like this article? Share it with your friends!') }}</p>
  50. <div class="addthis_native_toolbox"></div>
  51. <div class="addthis_sharing_toolbox"></div>
  52. <div class="addthis_inline_share_toolbox"></div>
  53. </div>
  54. {% endif %}
  55. {% include "partial/neighbors.html" %}
  56. {% if article.related_posts %}
  57. <div class="related-posts">
  58. <h4>{{ _('You might enjoy') }}</h4>
  59. <ul class="related-posts">
  60. {% for related_post in article.related_posts %}
  61. <li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
  62. {% endfor %}
  63. </ul>
  64. </div>
  65. {% elif ADD_THIS_ID %}
  66. <div class="addthis_relatedposts_inline"></div>
  67. {% endif %}
  68. {% if ISSO_SERVER %}
  69. <script data-isso="{{ ISSO_SERVER }}/" src="{{ ISSO_SERVER }}/js/embed.min.js"></script>
  70. {% endif %}
  71. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.article_bottom %}
  72. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  73. <ins class="adsbygoogle ads-responsive"
  74. data-ad-client="{{ GOOGLE_ADSENSE.ca_id }}"
  75. data-ad-slot="{{ GOOGLE_ADSENSE.ads.article_bottom }}"></ins>
  76. <script>
  77. (adsbygoogle = window.adsbygoogle || []).push({});
  78. </script>
  79. {% endif %}
  80. {% include "partial/disqus.html" %}
  81. {% include "partial/isso.html" %}
  82. </article>
  83. {% endblock %}