article.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {% extends "base.html" %}
  2. {% block html_lang %}{{ article.lang }}{% endblock %}
  3. {% block head %}
  4. {% block title %}
  5. <title>{{ article.title }} - {{SITENAME}}</title>
  6. {% endblock %}
  7. {{ super() }}
  8. {% import 'translations.html' as translations with context %}
  9. {% if translations.entry_hreflang(article) %}
  10. {{ translations.entry_hreflang(article) }}
  11. {% endif %}
  12. <!-- plyr -->
  13. <link href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/modules/plyr/plyr.css" rel="stylesheet">
  14. <!--/ plyr -->
  15. {% if article.styles %}
  16. {% for style in article.styles %}
  17. {{ style }}
  18. {% endfor %}
  19. {% endif %}
  20. {% block seo %}
  21. {% set seo_description = article.summary|striptags %}
  22. {% set SEO_DESC_LENGTH = 160 %}
  23. {% if seo_description|length >= SEO_DESC_LENGTH %}
  24. {# Quita la última palabra para no dejarla incompleta #}
  25. {% set seo_description = seo_description[:SEO_DESC_LENGTH].split(' ')[:-1]|join(' ') %}
  26. {% if not seo_description[-1] in ['.', '?', ':', '!'] %}
  27. {% set seo_more = seo_description + '…' %}
  28. {% set seo_description = seo_more|replace('"','') %}
  29. {% endif %}
  30. {% endif %}
  31. <!-- Article Image -->
  32. {% set article_image = "%s/%s/../wp-content/uploads/article/thumbnail/%s" % (SITEURL, THEME_STATIC_DIR, article.image) %}
  33. <!-- Meta Article -->
  34. <meta name="author" content="{{ article.author }}"/>
  35. <meta name="description" content="{{ seo_description|striptags }}"/>
  36. <meta name="keywords" content="{{ article.tags|join(',')|escape }}"/>
  37. <!-- Schema -->
  38. <meta itemprop="name" content="{{ article.title }}"/>
  39. <meta itemprop="description" content="{{ seo_description|striptags }}"/>
  40. <meta itemprop="uploadDate" content="{{ article.date.isoformat() }}"/>
  41. <meta itemprop="thumbnailURL" content="{{ article_image }}"/>
  42. <!-- OpenGraph -->
  43. <meta property="article:section" content="{{ article.category }}"/>
  44. <meta property="video:release_date" content="{{ article.date.isoformat() }}"/>
  45. {% if article.modified %}
  46. <meta property="article:modified_time" content="{{ article.modified.isoformat() }}"/>
  47. {% endif %}
  48. <meta property="og:title" content="{{ article.title }}"/>
  49. <meta property="og:type" content="video.movie"/>
  50. <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}"/>
  51. <meta property="og:description" content="{{ seo_description|striptags }}"/>
  52. <meta property="og:image" content="{{ article_image }}"/>
  53. {% for tag in article.tags %}
  54. <meta property="og:video:tag" content="{{ tag | escape }}"/>
  55. {% endfor %}
  56. {% if article.og_video %}
  57. <!-- videograph -->
  58. <meta property="og:video" content="{{ article.og_video }}"/>
  59. <meta property="og:video:secure_url" content="{{ article.og_video }}"/>
  60. <meta property="og:video:type" content="video/webm"/>
  61. <meta property="og:video:width" content="400"/>
  62. <meta property="og:video:height" content="300"/>
  63. <!-- /videograph -->
  64. {% endif %}
  65. <!-- Twitter -->
  66. <meta name="twitter:card" content="summary"/>
  67. <meta name="twitter:title" content="{{ article.title }} - {{ SITENAME }}"/>
  68. <meta name="twitter:description" content="{{ seo_description|striptags }}"/>
  69. <meta name="twitter:url" content="{{ SITEURL }}/{{ article.url }}"/>
  70. <meta name="twitter:image" content="{{ article_image }}"/>
  71. {% endblock %}
  72. {% endblock %}
  73. {% block menu_header %} <!-- empty -->{% endblock menu_header %}
  74. {%- block content -%}
  75. <!-- Main -->
  76. <main class="row mt-3 mt-10">
  77. <div class="col-md-12">
  78. <div class="row mr-3">
  79. <div class="col-md-8">
  80. <!-- dinamic article content -->
  81. <div class="ml-3 mb-3">
  82. {{ article.content }}
  83. </div>
  84. <!-- End dinamic article content -->
  85. <!-- License -->
  86. <div class="d-flex align-items-center ml-3">
  87. <h6 class="mr-3 font-weight-bold">{{ _('Licencia') }}</h6>
  88. {% if article.license == LICENSE['allrights']['name'] %}
  89. <!-- allrights -->
  90. <a>{{ article.license }}</a>
  91. <!-- cc - version 4 -->
  92. {% elif article.license == LICENSE['ccby4']['name']%}
  93. <!-- ccby4 -->
  94. <a href="{{ LICENSE['ccby4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccby4']['fullname'] }}">{{ article.license }}</abbr></a>
  95. {% elif article.license == LICENSE['ccbysa4']['name']%}
  96. <!-- ccbysa4 -->
  97. <a href="{{ LICENSE['ccbysa4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbysa4']['fullname'] }}">{{ article.license }}</abbr></a>
  98. {% elif article.license == LICENSE['ccbynd4']['name']%}
  99. <!-- ccbynd4 -->
  100. <a href="{{ LICENSE['ccbynd4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbynd4']['fullname'] }}">{{ article.license }}</abbr></a>
  101. {% elif article.license == LICENSE['ccbync4']['name']%}
  102. <!-- ccbync4 -->
  103. <a href="{{ LICENSE['ccbync4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbync4']['fullname'] }}">{{ article.license }}</abbr></a>
  104. {% elif article.license == LICENSE['ccbyncsa4']['name']%}
  105. <!-- ccbyncsa4 -->
  106. <a href="{{ LICENSE['ccbyncsa4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncsa4']['fullname'] }}">{{ article.license }}</abbr></a>
  107. {% elif article.license == LICENSE['ccbyncnd4']['name']%}
  108. <!-- ccbyncnd4 -->
  109. <a href="{{ LICENSE['ccbyncnd4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncnd4']['fullname'] }}">{{ article.license }}</abbr></a>
  110. <!-- cc - version 3 -->
  111. {% elif article.license == LICENSE['ccby3']['name']%}
  112. <!-- ccby3 -->
  113. <a href="{{ LICENSE['ccby3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccby3']['fullname'] }}">{{ article.license }}</abbr></a>
  114. {% elif article.license == LICENSE['ccbysa3']['name']%}
  115. <!-- ccbysa3 -->
  116. <a href="{{ LICENSE['ccbysa3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbysa3']['fullname'] }}">{{ article.license }}</abbr></a>
  117. {% elif article.license == LICENSE['ccbynd3']['name']%}
  118. <!-- ccbynd3 -->
  119. <a href="{{ LICENSE['ccbynd3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbynd3']['fullname'] }}">{{ article.license }}</abbr></a>
  120. {% elif article.license == LICENSE['ccbync3']['name']%}
  121. <!-- ccbync3 -->
  122. <a href="{{ LICENSE['ccbync3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbync3']['fullname'] }}">{{ article.license }}</abbr></a>
  123. {% elif article.license == LICENSE['ccbyncsa3']['name']%}
  124. <!-- ccbyncsa3 -->
  125. <a href="{{ LICENSE['ccbyncsa3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncsa3']['fullname'] }}">{{ article.license }}</abbr></a>
  126. {% elif article.license == LICENSE['ccbyncnd3']['name']%}
  127. <!-- ccbyncnd3 -->
  128. <a href="{{ LICENSE['ccbyncnd3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncnd3']['fullname'] }}">{{ article.license }}</abbr></a>
  129. {% elif article.license == LICENSE['cc01']['name']%}
  130. <!-- cc01 -->
  131. <a href="{{ LICENSE['cc01']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['cc01']['fullname'] }}">{{ article.license }}</abbr></a>
  132. {% elif article.license == LICENSE['publicdomain']['name']%}
  133. <!-- publicdomanin -->
  134. <a href="{{ LICENSE['publicdomain']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['publicdomain']['fullname'] }}">{{ article.license }}</abbr></a>
  135. {% else %}
  136. <a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="noopener noreferrer" target="_blank"><abbr title="Attribution-ShareAlike 4.0 International">CC BY-SA 4.0</abbr></a>
  137. {% endif %}
  138. </div>
  139. <!-- /License -->
  140. <!-- Author -->
  141. <div class="ml-3">
  142. <hr class="hr-author">
  143. <p class="mb-0">
  144. {% if not HIDE_AUTHORS and article.authors %}
  145. <span class="soumaicon text-info">
  146. <svg>
  147. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#user" />
  148. </svg>
  149. </span>
  150. {% for author in article.authors %}
  151. <a class="link-author" href="{{ SITEURL }}/{{ author.url }}" title="{{ author }}">{{ author }}</a>
  152. <span class="style-scope">
  153. <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false">
  154. <g>
  155. <path fill-rule="evenodd" clip-rule="evenodd" d="M12,2C6.48,2,2,6.48,2,12s4.48,10,10,10s10-4.48,10-10 S17.52,2,12,2z M9.92,17.93l-4.95-4.95l2.05-2.05l2.9,2.9l7.35-7.35l2.05,2.05L9.92,17.93z" class="style-scope yt-icon"></path>
  156. </g>
  157. </svg>
  158. </span>
  159. {% endfor %}
  160. {% endif %}
  161. </p>
  162. <!-- time publish -->
  163. {% set año = article.date|strftime('%Y') %}
  164. {% set mes = article.date|strftime('%m') %}
  165. {% set nombre_mes = article.date|strftime('%B') %}
  166. <time class="entry-date published"
  167. datetime="{{ article.date.isoformat() }}">
  168. <small>
  169. {{ _('Publicado el') }}
  170. {{ article.date|strftime('%a %-d') }}
  171. <a class="text-info" href="{{ SITEURL }}/archives/{{ año }}/{{ mes }}/"
  172. title="{% trans %}Vídeos de {{ nombre_mes }} de {{ año }}{% endtrans %}">
  173. {{ nombre_mes }}
  174. </a>
  175. {{ _('de') }}
  176. <a class="text-secondary" href="{{ SITEURL }}/archives/{{ año }}/"
  177. title="{% trans %}Vídeos de {{ año }}{% endtrans %}">{{ año }}
  178. </a>
  179. </small>
  180. </time>
  181. <!-- /time publish -->
  182. <hr class="hr-author">
  183. </div>
  184. <!-- /Author -->
  185. <!-- Comments -->
  186. <div id="hashover" class="comments-container mt-4 ml-3">
  187. <script src="/hashover-next/comments.php"></script>
  188. <noscript>
  189. <p>{% trans trimmed abre_enlace='<a href="mailto:heckyel@hyperbola.info?subject=Comentario_«%(titulo_art)s»">'|format(titulo_art=article.title|replace(' ', '%20')), cierra_enlace='</a>' %}
  190. Lo siento, el sistema de comentarios no funciona sin JavaScript. Si
  191. deseas, puedes {{ abre_enlace }} enviar tu comentario por correo
  192. electrónico {{ cierra_enlace }}. El comentario será publicado en el espacio
  193. reservado a comentarios de esta página.{% endtrans %}</p>
  194. </noscript>
  195. </div>
  196. <!--End Comments -->
  197. </div>
  198. {% if SHOW_RECENT_POSTS %}
  199. <div class="col-md-4">
  200. <!-- article video 1 -->
  201. {% for article in articles[:SHOW_RECENT_POSTS] %}
  202. <article class="row justify-content-center align-items-center mt-1">
  203. <!-- video next -->
  204. <div class="col-md-6 mini">
  205. <a href="{{ SITEURL }}/{{ article.url }}">
  206. <div class="area">
  207. <div class="mask">
  208. <div class="vertical-align">
  209. <i class="soumaicon play"><svg><use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#play"/></svg></i>
  210. </div> <!-- End Vertical Align -->
  211. </div> <!-- End Mask / Hover -->
  212. {% if article.image %}
  213. <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/../wp-content/uploads/article/thumbnail/{{ article.image }}" alt="{{ article.title }}" class="img-fluid">
  214. {% else %}
  215. <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/video.png" alt="video" class="img-fluid">
  216. {% endif %}
  217. {% if article.time %}
  218. <span class="duration">{{ article.time }}</span>
  219. {% else %}
  220. <span class="duration">{{ ('00:00') }}</span>
  221. {% endif %}
  222. </div> <!-- End Area -->
  223. </a>
  224. </div>
  225. <!-- video next -->
  226. <!-- description -->
  227. <div class="col-md-6">
  228. <h6><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="{{ _('Ver %(articulo)s', articulo=article.title|striptags) }}">{{ article.title }}</a></h6>
  229. {% include "article_info_aside.html" %}
  230. </div>
  231. </article>
  232. {% endfor %}
  233. </div>
  234. {% endif %}
  235. </div>
  236. </div>
  237. </main>
  238. <!-- End Main -->
  239. {%- endblock -%}
  240. {% block extend_js %}
  241. <!-- Plyr -->
  242. <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/modules/plyr/plyr.min.js"
  243. integrity="sha512-l6ZzdXpfMHRfifqaR79wbYCEWjLDMI9DnROvb+oLkKq6d7MGroGpMbI7HFpicvmAH/2aQO+vJhewq8rhysrImw=="
  244. crossorigin="anonymous"></script>
  245. <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/play.js"></script>
  246. <!-- /Plyr -->
  247. {% endblock %}