article.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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 "include/og_article.html" %}
  7. {% endblock meta%}
  8. {% block title %}
  9. {{ article.title|striptags|escape }} &ndash; {{ SITENAME }}
  10. {% endblock title %}
  11. {% block header %}
  12. <div class="container">
  13. <h3 id="{{ article.slug }}">{{ article.title }}</h3>
  14. <p style="font-size:larger;">{{ article.summary }}</p>
  15. <div class="row mx-auto mt-3">
  16. <div class="col-xs-12 col-sm-12 col-md-6 text-left" style="padding: 0">
  17. <a href="{{ SITEURL }}/{{ article.author.url }}" class="card-link">{{ article.author }}</a>
  18. <span class="card-link text-success">
  19. <span class="post-date" title="Post date">{{ article.locale_date }}</span>
  20. <span class="text-info modified-date" title="Updated date">
  21. {% if article.modified %}
  22. {{ article.locale_modified }}
  23. {% else %}
  24. {{ article.locale_date }}
  25. {% endif %}
  26. </span>
  27. </span>
  28. {% if article.stats %}
  29. <span class="card-link text-secondary" title="~{{ article.stats['wc'] }} words">{{ article.stats['read_mins'] }} mins</span>
  30. {% elif article.readtime %}
  31. <span class="card-link text-secondary" title="Read time">{{ article.readtime }}</span>
  32. {% endif %}
  33. </div>
  34. <div class="col-xs-12 col-sm-12 col-md-6 text-right" style="padding: 0">
  35. <a class="badge badge-success" href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category|lower }}</a>
  36. {% for tag in article.tags %}
  37. <a class="badge badge-info" href="{{ SITEURL }}/{{ tag.url }}">{{ tag|lower }}</a>
  38. {% endfor %}
  39. </div>
  40. </div>
  41. </div>
  42. {% endblock header %}
  43. {% block content %}
  44. <!-- 2 columns layout -->
  45. {% if article.toc == 'show' %}
  46. <div class="row">
  47. <div class="col-xs-12 col-sm-12 col-md-10">
  48. {% block add_this %}
  49. {# remove ADD_THIS in content, move to inner column #}
  50. {% endblock add_this %}
  51. <!-- Sharing -->
  52. {% if ADD_THIS_ID and (page_name or page or article) %}
  53. <div class="text-right mb-2 small" style="height: 26px">
  54. <div class="addthis_inline_share_toolbox"></div>
  55. </div>
  56. {% endif %}
  57. <!-- Article -->
  58. {{ article.content }}
  59. <!-- Neighbors -->
  60. {% if article.prev_article or article.next_article %}
  61. <br>
  62. <b>Read more:</b><br>
  63. {% include "include/neighbors.html" %}
  64. {% endif %}
  65. <!-- Google Adsense -->
  66. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.sidebar %}
  67. <br>
  68. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  69. <!-- ad-sidebar -->
  70. <ins class="adsbygoogle"
  71. style="display:block"
  72. data-ad-client="{{ GOOGLE_ADSENSE.id }}"
  73. data-ad-slot="{{ GOOGLE_ADSENSE.ads.sidebar }}"
  74. data-ad-format="auto"
  75. data-full-width-responsive="true"></ins>
  76. <script>
  77. (adsbygoogle = window.adsbygoogle || []).push({});
  78. </script>
  79. {% endif %}
  80. </div>
  81. <!-- Sidebar -->
  82. <div class="col-md-2 d-none d-md-block small">
  83. <div class="sticky-top">
  84. <!-- ToC -->
  85. <nav id="toc" data-toggle="toc" ></nav>
  86. <!-- Share post -->
  87. {% if SHARE_POST and article.share_post and article.status != 'draft' %}
  88. <hr>
  89. <div id="post-share-links">
  90. <p>Share on:</p>
  91. <a class="mx-auto" href="{{article.share_post['twitter']}}" target="_blank" title="Share on Twitter">
  92. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  93. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z" fill="currentColor"></path>
  94. </svg>
  95. </a>
  96. <a class="mx-auto" href="{{article.share_post['facebook']}}" target="_blank" title="Share on Facebook">
  97. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  98. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z" fill="currentColor"></path>
  99. </svg>
  100. </a>
  101. <a class="mx-auto" href="{{article.share_post['linkedin']}}" target="_blank" title="Share on LinkedIn">
  102. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  103. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z" fill="currentColor"></path>
  104. </svg>
  105. </a>
  106. </div>
  107. {% endif %}
  108. <!-- Google Adsense -->
  109. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.sidebar %}
  110. <br>
  111. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  112. <!-- ad-sidebar -->
  113. <ins class="adsbygoogle"
  114. style="display:block"
  115. data-ad-client="{{ GOOGLE_ADSENSE.id }}"
  116. data-ad-slot="{{ GOOGLE_ADSENSE.ads.sidebar }}"
  117. data-ad-format="auto"
  118. data-full-width-responsive="true"></ins>
  119. <script>
  120. (adsbygoogle = window.adsbygoogle || []).push({});
  121. </script>
  122. {% endif %}
  123. </div>
  124. </div>
  125. </div>
  126. {% else %}
  127. <!-- single column layout -->
  128. <!-- Sharing -->
  129. {% if ADD_THIS_ID and (page_name or page or article) %}
  130. <div class="text-right mb-2 small" style="height: 26px">
  131. <div class="addthis_inline_share_toolbox"></div>
  132. </div>
  133. {% endif %}
  134. <!-- Share post -->
  135. {% if SHARE_POST and article.share_post and article.status != 'draft' %}
  136. <div id="post-share-links" class="text-right mb-2">
  137. Share on:
  138. <a href="{{article.share_post['twitter']}}" target="_blank" title="Share on Twitter">
  139. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  140. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z" fill="currentColor"></path>
  141. </svg>
  142. </a>
  143. <a href="{{article.share_post['facebook']}}" target="_blank" title="Share on Facebook">
  144. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  145. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z" fill="currentColor"></path>
  146. </svg>
  147. </a>
  148. <a href="{{article.share_post['linkedin']}}" target="_blank" title="Share on LinkedIn">
  149. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  150. <path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z" fill="currentColor"></path>
  151. </svg>
  152. </a>
  153. </div>
  154. {% endif %}
  155. <!-- Article -->
  156. <div>
  157. {{ article.content }}
  158. </div>
  159. <!-- Neighbors -->
  160. {% if article.prev_article or article.next_article %}
  161. <br>
  162. <b>Read more:</b><br>
  163. {% include "include/neighbors.html" %}
  164. {% endif %}
  165. <!-- Google Adsense -->
  166. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.article %}
  167. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  168. <!-- ad-home -->
  169. <ins class="adsbygoogle"
  170. style="display:block"
  171. data-ad-client="{{ GOOGLE_ADSENSE.id }}"
  172. data-ad-slot="{{ GOOGLE_ADSENSE.ads.article }}"
  173. data-ad-format="auto"
  174. data-full-width-responsive="true"></ins>
  175. <script>
  176. (adsbygoogle = window.adsbygoogle || []).push({});
  177. </script>
  178. {% endif %}
  179. {% endif %}
  180. <!-- Releated posts -->
  181. {% if article.related_posts %}
  182. <hr>
  183. <div>
  184. <h5>Related posts:</h5>
  185. <ul>
  186. {% for related_post in article.related_posts %}
  187. <li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
  188. {% endfor %}
  189. </ul>
  190. </div>
  191. {% endif %}
  192. <!-- Comments -->
  193. {% if DISQUS_SITENAME %}
  194. <hr>
  195. {% include "include/disqus.html" %}
  196. {% endif %}
  197. {% endblock content %}