css
html
javascript
python
makefile

article.html 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. {% endblock %}
  7. {% block head %}
  8. {{ super() }}
  9. {% import 'translations.html' as translations with context %}
  10. {% if translations.entry_hreflang(article) %}
  11. {{ translations.entry_hreflang(article) }}
  12. {% endif %}
  13. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  14. <meta property="og:title" content="{{ article.title }}">
  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. {% endblock %}
  51. {% block title %}{{ article.title|striptags }}{% endblock %}
  52. {% block content %}
  53. <div class="container">
  54. <!-- start of posts -->
  55. <div class="columns is-multiline is-centered">
  56. <!-- start of post -->
  57. <article class="column is-10">
  58. <div class="card">
  59. <!-- post header -->
  60. <div class="card-content-header">
  61. <h2 class="title is-4 has-text-centered" id="titulo">{{ article.title }}</h2>
  62. </div>
  63. <!-- end of post header -->
  64. <!-- post content -->
  65. <div class="card-content">
  66. <div class="content">
  67. <div class="card-inner-wrapper">
  68. <!-- post text -->
  69. <div class="card-content-text has-text-justified">
  70. {{ article.content }}
  71. </div>
  72. <!-- end of post text -->
  73. <!-- post footer -->
  74. <div class="card-content-footer-small">
  75. <div class="navbar is-social-center">
  76. <a class="navbar-item" href="{{ SOCIAL['gnusocial'] }}">
  77. <span class="soumaicon">
  78. <svg>
  79. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/icons/master.svg#gnusocial" />
  80. <title>GNUSocial</title>
  81. </svg>
  82. </span>
  83. </a>
  84. <a class="navbar-item" href="{{ SOCIAL['diaspora'] }}">
  85. <span class="soumaicon">
  86. <svg>
  87. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/icons/master.svg#diaspora" />
  88. <title>Diaspora</title>
  89. </svg>
  90. </span>
  91. </a>
  92. <a class="navbar-item" href="{{ SOCIAL['mastodom'] }}">
  93. <span class="soumaicon">
  94. <svg>
  95. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/icons/master.svg#mastodom" />
  96. <title>Mastodom</title>
  97. </svg>
  98. </span>
  99. </a>
  100. </div>
  101. <!-- post footer nav -->
  102. <div class="columns">
  103. <div class="column has-text-left">
  104. <a class="button is-small is-button-grey" href="{{ SITEURL }}/">{{ _('Regresar al Inicio') }}</a>
  105. </div>
  106. <div class="column has-text-right">
  107. <span class="soumaicon">
  108. <svg>
  109. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/icons/master.svg#calendar" />
  110. </svg>
  111. </span>
  112. {% set año = article.date|strftime('%Y') %}
  113. {% set mes = article.date|strftime('%m') %}
  114. {% set nombre_mes = article.date|strftime('%B') %}
  115. <time class="entry-date published"
  116. datetime="{{ article.date.isoformat() }}">
  117. <small>
  118. {{ article.date|strftime('%a %-d') }}
  119. <a href="{{ SITEURL }}/archives/{{ año }}/{{ mes }}/"
  120. title="{% trans %}Artículos de {{ nombre_mes }} de {{ año }}{% endtrans %}">
  121. {{ nombre_mes }}
  122. </a>
  123. <a href="{{ SITEURL }}/archives/{{ año }}/"
  124. title="{% trans %}Artículos de {{ año }}{% endtrans %}">{{ año }}
  125. </a>
  126. </small>
  127. </time>
  128. {% if not HIDE_AUTHORS and article.authors %}
  129. <span class="soumaicon">
  130. <svg>
  131. <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/icons/master.svg#user"/>
  132. </svg>
  133. </span>
  134. {% for author in article.authors %}
  135. <small>
  136. <a href="{{ SITEURL }}/{{ author.url }}"
  137. title="{% trans %}Autor del artículo{% endtrans %}">{{ author }}</a>{% if not loop.last %}, {% endif %}
  138. </small>
  139. {% endfor %}
  140. {% endif %}
  141. </div>
  142. </div>
  143. <!-- end of post footer nav -->
  144. </div>
  145. <!-- end of post footer -->
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <!-- end of post content -->
  151. </article>
  152. <!-- end of post -->
  153. </div>
  154. <!-- end of post column -->
  155. </div>
  156. {% endblock %}