article.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. <?php
  78. if(isset($_SERVER['HTTPS'])) {
  79. if ($_SERVER['HTTPS'] == "on") {
  80. $examen = "https://{$_SERVER['HTTP_HOST']}/examen";
  81. }
  82. else {
  83. $examen = "examen";
  84. }
  85. }
  86. echo "<div class='col-sm'><div class='d-flex justify-content-center'><a href='{$examen}'>Examen</a></div></div>";
  87. include_once('../php-personal/index.php');
  88. $isCookied = isset($_COOKIE['identify'], $_COOKIE['hash']);
  89. $isIdentify = false;
  90. if ($isCookied) {
  91. //index properties
  92. $post = new Post($db);
  93. $post->identify = $_COOKIE['identify'];
  94. $post->hash = $_COOKIE['hash'];
  95. $isIdentify = $post->identify();
  96. if (!$isIdentify) {
  97. echo '<div class="col-sm"><div class="d-flex justify-content-center"><a href="php-personal/frontend/users">Identificarse</a></div></div>';
  98. return;
  99. }
  100. }
  101. if (!$isCookied) {
  102. echo '<div class="col-sm"><div class="d-flex justify-content-center"><a href="php-personal/frontend/users">Identificarse</a></div></div>';
  103. return;
  104. }
  105. ?>
  106. <div class="col-md-12">
  107. <div class="row mr-3">
  108. <div class="col-md-8">
  109. <!-- dinamic article content -->
  110. <div class="ml-3 mb-3">
  111. {{ article.content }}
  112. </div>
  113. <!-- End dinamic article content -->
  114. <!-- License -->
  115. <div class="d-flex align-items-center ml-3">
  116. <h6 class="mr-3 font-weight-bold">{{ _('Licencia') }}</h6>
  117. {% if article.license == LICENSE['allrights']['name'] %}
  118. <!-- allrights -->
  119. <a>{{ article.license }}</a>
  120. <!-- cc - version 4 -->
  121. {% elif article.license == LICENSE['ccby4']['name']%}
  122. <!-- ccby4 -->
  123. <a href="{{ LICENSE['ccby4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccby4']['fullname'] }}">{{ article.license }}</abbr></a>
  124. {% elif article.license == LICENSE['ccbysa4']['name']%}
  125. <!-- ccbysa4 -->
  126. <a href="{{ LICENSE['ccbysa4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbysa4']['fullname'] }}">{{ article.license }}</abbr></a>
  127. {% elif article.license == LICENSE['ccbynd4']['name']%}
  128. <!-- ccbynd4 -->
  129. <a href="{{ LICENSE['ccbynd4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbynd4']['fullname'] }}">{{ article.license }}</abbr></a>
  130. {% elif article.license == LICENSE['ccbync4']['name']%}
  131. <!-- ccbync4 -->
  132. <a href="{{ LICENSE['ccbync4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbync4']['fullname'] }}">{{ article.license }}</abbr></a>
  133. {% elif article.license == LICENSE['ccbyncsa4']['name']%}
  134. <!-- ccbyncsa4 -->
  135. <a href="{{ LICENSE['ccbyncsa4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncsa4']['fullname'] }}">{{ article.license }}</abbr></a>
  136. {% elif article.license == LICENSE['ccbyncnd4']['name']%}
  137. <!-- ccbyncnd4 -->
  138. <a href="{{ LICENSE['ccbyncnd4']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncnd4']['fullname'] }}">{{ article.license }}</abbr></a>
  139. <!-- cc - version 3 -->
  140. {% elif article.license == LICENSE['ccby3']['name']%}
  141. <!-- ccby3 -->
  142. <a href="{{ LICENSE['ccby3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccby3']['fullname'] }}">{{ article.license }}</abbr></a>
  143. {% elif article.license == LICENSE['ccbysa3']['name']%}
  144. <!-- ccbysa3 -->
  145. <a href="{{ LICENSE['ccbysa3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbysa3']['fullname'] }}">{{ article.license }}</abbr></a>
  146. {% elif article.license == LICENSE['ccbynd3']['name']%}
  147. <!-- ccbynd3 -->
  148. <a href="{{ LICENSE['ccbynd3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbynd3']['fullname'] }}">{{ article.license }}</abbr></a>
  149. {% elif article.license == LICENSE['ccbync3']['name']%}
  150. <!-- ccbync3 -->
  151. <a href="{{ LICENSE['ccbync3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbync3']['fullname'] }}">{{ article.license }}</abbr></a>
  152. {% elif article.license == LICENSE['ccbyncsa3']['name']%}
  153. <!-- ccbyncsa3 -->
  154. <a href="{{ LICENSE['ccbyncsa3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncsa3']['fullname'] }}">{{ article.license }}</abbr></a>
  155. {% elif article.license == LICENSE['ccbyncnd3']['name']%}
  156. <!-- ccbyncnd3 -->
  157. <a href="{{ LICENSE['ccbyncnd3']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['ccbyncnd3']['fullname'] }}">{{ article.license }}</abbr></a>
  158. {% elif article.license == LICENSE['cc01']['name']%}
  159. <!-- cc01 -->
  160. <a href="{{ LICENSE['cc01']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['cc01']['fullname'] }}">{{ article.license }}</abbr></a>
  161. {% elif article.license == LICENSE['publicdomain']['name']%}
  162. <!-- publicdomanin -->
  163. <a href="{{ LICENSE['publicdomain']['url'] }}" rel="noopener noreferrer" target="_blank"><abbr title="{{ LICENSE['publicdomain']['fullname'] }}">{{ article.license }}</abbr></a>
  164. {% else %}
  165. <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>
  166. {% endif %}
  167. </div>
  168. <!-- /License -->
  169. <!-- Author -->
  170. <div class="ml-3">
  171. <hr class="hr-author">
  172. <p class="mb-0">
  173. {% if not HIDE_AUTHORS and article.authors %}
  174. <span class="soumaicon text-info">
  175. <svg>
  176. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#user" />
  177. </svg>
  178. </span>
  179. {% for author in article.authors %}
  180. <a class="link-author" href="{{ SITEURL }}/{{ author.url }}" title="{{ author }}">{{ author }}</a>
  181. <span class="style-scope">
  182. <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false">
  183. <g>
  184. <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>
  185. </g>
  186. </svg>
  187. </span>
  188. {% endfor %}
  189. {% endif %}
  190. </p>
  191. <!-- time publish -->
  192. {% set año = article.date|strftime('%Y') %}
  193. {% set mes = article.date|strftime('%m') %}
  194. {% set nombre_mes = article.date|strftime('%B') %}
  195. <time class="entry-date published"
  196. datetime="{{ article.date.isoformat() }}">
  197. <small>
  198. {{ _('Publicado el') }}
  199. {{ article.date|strftime('%a %-d') }}
  200. <a class="text-info" href="{{ SITEURL }}/archives/{{ año }}/{{ mes }}/"
  201. title="{% trans %}Vídeos de {{ nombre_mes }} de {{ año }}{% endtrans %}">
  202. {{ nombre_mes }}
  203. </a>
  204. {{ _('de') }}
  205. <a class="text-secondary" href="{{ SITEURL }}/archives/{{ año }}/"
  206. title="{% trans %}Vídeos de {{ año }}{% endtrans %}">{{ año }}
  207. </a>
  208. </small>
  209. </time>
  210. <!-- /time publish -->
  211. <hr class="hr-author">
  212. </div>
  213. <!-- /Author -->
  214. <!-- Comments -->
  215. <div id="hashover" class="comments-container mt-4 ml-3">
  216. <script src="/hashover-next/comments.php"></script>
  217. <noscript>
  218. <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>' %}
  219. Lo siento, el sistema de comentarios no funciona sin JavaScript. Si
  220. deseas, puedes {{ abre_enlace }} enviar tu comentario por correo
  221. electrónico {{ cierra_enlace }}. El comentario será publicado en el espacio
  222. reservado a comentarios de esta página.{% endtrans %}</p>
  223. </noscript>
  224. </div>
  225. <!--End Comments -->
  226. </div>
  227. {% if SHOW_RECENT_POSTS %}
  228. <div class="col-md-4">
  229. <!-- article video 1 -->
  230. {% for article in articles[:SHOW_RECENT_POSTS] %}
  231. <article class="row justify-content-center align-items-center mt-1">
  232. <!-- video next -->
  233. <div class="col-md-6 mini">
  234. <a href="{{ SITEURL }}/{{ article.url }}">
  235. <div class="area">
  236. <div class="mask">
  237. <div class="vertical-align">
  238. <i class="soumaicon play"><svg><use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#play"/></svg></i>
  239. </div> <!-- End Vertical Align -->
  240. </div> <!-- End Mask / Hover -->
  241. {% if article.image %}
  242. <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/../wp-content/uploads/article/thumbnail/{{ article.image }}" alt="{{ article.title }}" class="img-fluid">
  243. {% else %}
  244. <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/video.png" alt="video" class="img-fluid">
  245. {% endif %}
  246. {% if article.time %}
  247. <!-- <span class="duration">{{ article.time }}</span> -->
  248. {% else %}
  249. <!-- <span class="duration">{{ ('00:00') }}</span> -->
  250. {% endif %}
  251. </div> <!-- End Area -->
  252. </a>
  253. </div>
  254. <!-- video next -->
  255. <!-- description -->
  256. <div class="col-md-6">
  257. <h6><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="{{ _('Ver %(articulo)s', articulo=article.title|striptags) }}">{{ article.title }}</a></h6>
  258. {% include "article_info_aside.html" %}
  259. </div>
  260. </article>
  261. {% endfor %}
  262. </div>
  263. {% endif %}
  264. </div>
  265. </div>
  266. </main>
  267. <!-- End Main -->
  268. {%- endblock -%}
  269. {% block extend_js %}
  270. <!-- Plyr -->
  271. <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/modules/plyr/plyr.min.js"
  272. integrity="sha512-l6ZzdXpfMHRfifqaR79wbYCEWjLDMI9DnROvb+oLkKq6d7MGroGpMbI7HFpicvmAH/2aQO+vJhewq8rhysrImw=="
  273. crossorigin="anonymous"></script>
  274. <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/play.js"></script>
  275. <!-- /Plyr -->
  276. {% endblock %}