article.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {% extends "base.html" %}
  2. {% block html_lang %}{{ article.lang }}{% endblock %}
  3. {% block extra_head %}
  4. <meta name="author" content="{{ article.author }}">
  5. <meta name="keywords" content="{{ article.tags|join(',')|escape }}">
  6. <script src="/hashover-next/api/count-link.php{% if article.lang != 'es' %}?nodefault{% endif%}"></script>
  7. {% endblock %}
  8. {% block head %}
  9. {{ super() }}
  10. {% import 'translations.html' as translations with context %}
  11. {% if translations.entry_hreflang(article) %}
  12. {{ translations.entry_hreflang(article) }}
  13. {% endif %}
  14. <meta property="og:title" content="{{ article.title|striptags }}">
  15. <meta property="og:type" content="article">
  16. <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}">
  17. <meta property="article:published_time" content="{{ article.date.isoformat() }}">
  18. {% if article.modified %}
  19. <meta property="article:modified_time" content="{{ article.modified.isoformat() }}">
  20. {% endif %}
  21. <meta property="article:section" content="{{ article.category }}">
  22. {% set og_description = article.summary.split(ANOTHER_READ_MORE_LINK_FORMAT[:6])[0][3:]|striptags|escape %}
  23. {% set OG_DESC_LENGTH = 175 %}
  24. {% if og_description|length >= OG_DESC_LENGTH %}
  25. {# Quita la última palabra para no dejarla incompleta #}
  26. {% set og_description = og_description[:OG_DESC_LENGTH].split(' ')[:-1]|join(' ') %}
  27. {% if not og_description[-1] in ['.', '?', ':', '!'] %}
  28. {% set og_description = og_description + '…' %}
  29. {% endif %}
  30. {% endif %}
  31. <meta property="og:description" content="{{ og_description }}">
  32. {% if article.image %}
  33. <meta property="og:image" content="{{ article.image.split('"')[1] }}">
  34. {% endif %}
  35. {% for tag in article.tags %}
  36. <meta property="og:tag" content="{{ tag | escape }}">
  37. {% endfor %}
  38. {% if article.styles %}
  39. {% for style in article.styles %}
  40. {{ style|format(SITEURL) }}
  41. {% endfor %}
  42. {% endif %}
  43. {% if article.js %}
  44. {% for script in article.js %}
  45. {% if 'top' in script[-7:] %}
  46. {{ script[:-5]|format(SITEURL) }}
  47. {% endif %}
  48. {% endfor %}
  49. {% endif %}
  50. {% if (article.next_article and article.next_article.image) or (article.prev_article and article.prev_article.image) %}
  51. <style>
  52. {% if article.next_article.image %}
  53. .post-navigation .nav-next { background-image: url({{ article.next_article.image.split('"')[1] if article.next_article.image }}); border-top: 0; }
  54. .post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; }
  55. .post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
  56. {% endif %}
  57. {% if article.prev_article.image %}
  58. .post-navigation .nav-previous { background-image: url({{ article.prev_article.image.split('"')[1] if article.prev_article.image }}); }
  59. .post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; }
  60. .post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
  61. {% endif %}
  62. </style>
  63. {% endif %}
  64. {% endblock %}
  65. {% block title %}{{ article.title|striptags }}{% endblock %}
  66. {% block content %}
  67. {% if article.image %}
  68. <article class="has-post-thumbnail post type-post status-publish format-standard hentry">
  69. <a class="post-thumbnail" href="{{ SITEURL }}/{{ article.url }}" aria-hidden="true">
  70. {{ article.image }}
  71. </a>
  72. {% else %}
  73. <article class="post type-post status-publish format-standard hentry">
  74. {% endif %}
  75. <header class="entry-header">
  76. <h1 class="entry-title" id="titulo">{{ article.title }}</h1>
  77. </header>
  78. <div class="entry-content">
  79. {{ article.content }}
  80. </div><!-- /.entry-content -->
  81. {% include 'article_info.html' %}
  82. </article>
  83. {% if article.prev_article or article.next_article %}
  84. <div class="navigation post-navigation" role="navigation">
  85. <h2 class="screen-reader-text">{{ _('Navegación de entradas') }} </h2>
  86. <div class="nav-links">
  87. {% if article.prev_article %}
  88. <div class="nav-previous">
  89. <a accesskey="A" href="{{ SITEURL }}/{{ article.prev_article.url }}" rel="prev">
  90. <span class="meta-nav" aria-hidden="true">{{ _('Anterior') }}</span>
  91. <span class="screen-reader-text">{{ _('Entrada anterior:') }}</span>
  92. <span class="post-title">{{ article.prev_article.title }}</span>
  93. </a>
  94. </div>
  95. {% endif %}
  96. {% if article.next_article %}
  97. <div class="nav-next">
  98. <a accesskey="S" href="{{ SITEURL }}/{{ article.next_article.url }}" rel="next">
  99. <span class="meta-nav" aria-hidden="true">{{ _('Siguiente') }}</span>
  100. <span class="screen-reader-text">{{ _('Entrada siguiente:') }}</span>
  101. <span class="post-title">{{ article.next_article.title }}</span>
  102. </a>
  103. </div>
  104. {% endif %}
  105. </div>
  106. </div>
  107. {% endif %}
  108. <div id="hashover" class="comments-area">
  109. <h2>{{ _('Comentarios') }}</h2>
  110. {% if DEFAULT_LANG == 'es' %}
  111. <script src="/hashover-next/comments.php"></script>
  112. {% else %}
  113. <script src="/hashover-next/loader.php"></script>
  114. <script>
  115. var hashover = new HashOver ('hashover', {
  116. settings: {
  117. language: '{{ HASHOVER_LANG }}',
  118. }
  119. });
  120. var countLink = new HashOverCountLink ({
  121. language: '{{ HASHOVER_LANG }}',
  122. });
  123. </script>
  124. {% endif %}
  125. <noscript>
  126. <p>{% trans trimmed abre_enlace='<a href="mailto:jorgesumle@freakspot.net?subject=Comentario_«%(titulo_art)s»">'|format(titulo_art=article.title|striptags|replace(' ', '%20')), cierra_enlace='</a>' %}
  127. Lo siento, el sistema de comentarios no funciona sin JavaScript. Si
  128. quieres, puedes {{ abre_enlace }}enviar tu comentario por correo
  129. electrónico{{ cierra_enlace }}. El comentario será publicado en el espacio
  130. reservado a comentarios de esta página.{% endtrans %}</p>
  131. </noscript>
  132. </div>
  133. {% endblock %}