aboutsummaryrefslogtreecommitdiffstats
path: root/libretube-theme/templates/article.html
blob: 0214d900b979b68bc5368c6b6d0a7b0583922060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
{% extends "base.html" %}

{% block html_lang %}{{ article.lang }}{% endblock %}

{% block extra_head %}
    <meta name="author" content="{{ article.author }}">
    <meta name="keywords" content="{{ article.tags|join(',')|escape }}">
{% endblock %}

{% block extra_comment %}
    <link href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/modules/plyr/plyr.css" rel="stylesheet">
{% endblock %}

{% block head %}
    {{ super() }}
    {% import 'translations.html' as translations with context %}
    {% if translations.entry_hreflang(article) %}
        {{ translations.entry_hreflang(article) }}
    {% endif %}
    <meta property="og:title" content="{{ article.title }}">
    <meta property="og:type" content="article">
    <meta property="og:url" content="{{ SITEURL }}/{{ article.url }}">
    <meta property="article:published_time" content="{{ article.date.isoformat() }}">
    {% if article.modified %}
        <meta property="article:modified_time" content="{{ article.modified.isoformat() }}">
    {% endif %}
    <meta property="article:section" content="{{ article.category }}">
    {% set og_description = article.summary.split(ANOTHER_READ_MORE_LINK_FORMAT[:6])[0][3:]|striptags|escape %}
    {% set OG_DESC_LENGTH = 175 %}
    {% if og_description|length >= OG_DESC_LENGTH %}
        {# Quita la última palabra para no dejarla incompleta #}
        {% set og_description = og_description[:OG_DESC_LENGTH].split(' ')[:-1]|join(' ') %}
        {% if not og_description[-1] in ['.', '?', ':', '!'] %}
            {% set og_description = og_description + '…' %}
        {% endif %}
    {% endif %}
    <meta property="og:description" content="{{ article.summary|striptags|escape }}"/>
    {% if article.og_image %}
        <meta property="og:image" content="{{ SITEURL }}/{{ article.og_image }}"/>
    {% elif OPEN_GRAPH_IMAGE %}
        <meta property="og:image" content="{{ SITEURL }}/{{ OPEN_GRAPH_IMAGE }}"/>
    {% endif %}
    {% for tag in article.tags %}
        <meta property="og:tag" content="{{ tag | escape }}">
    {% endfor %}

    {% if article.styles %}
        {% for style in article.styles %}
            {{ style }}
        {% endfor %}
    {% endif %}

{% endblock %}

{% block title %}{{ article.title|striptags }}{% endblock %}
{% block menu_header %}{% endblock menu_header %}

{%- block content -%}
    <!-- Main -->
    <div class="row mt-3 mt-10">
        <div class="col-md-12">
            <div class="row mr-3">
                <div class="col-md-8">

                    <!-- dinamic article content  -->
                    <div class="ml-3">
                        {{ article.content }}
                    </div>
                    <!-- End dinamic article content  -->

                    <!-- Author -->
                    <div class="ml-3">
                        <hr class="hr-author">

                        <p class="mb-0">
                            {% if not HIDE_AUTHORS and article.authors %}
                                <span class="soumaicon text-info">
                                    <svg>
                                        <use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#user" />
                                    </svg>
                                </span>
                                {% for author in article.authors %}
                                    <a class="link-author" href="{{ SITEURL }}/{{ author.url }}" title="{{ author }}">{{ author }}</a>
                                    <span class="style-scope">
                                        <svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false">
                                            <g>
                                                <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>
                                            </g>
                                        </svg>
                                    </span>
                                {% endfor %}
                            {% endif %}
                        </p>

                        <!-- time publish -->
                        {% set año = article.date|strftime('%Y') %}
                        {% set mes = article.date|strftime('%m') %}
                        {% set nombre_mes = article.date|strftime('%B') %}
                        <time class="entry-date published"
                              datetime="{{ article.date.isoformat() }}">
                            <small>
                                {{ _('Publicado el') }}
                                {{ article.date|strftime('%a %-d') }}
                                <a class="text-info" href="{{ SITEURL }}/archives/{{ año }}/{{ mes }}/"
                                   title="{% trans %}Vídeos de {{ nombre_mes }} de {{ año }}{% endtrans %}">
                                    {{ nombre_mes }}
                                </a>
                                {{ _('de') }}
                                <a class="text-secondary" href="{{ SITEURL }}/archives/{{ año }}/"
                                   title="{% trans %}Vídeos de {{ año }}{% endtrans %}">{{ año }}
                                </a>
                            </small>
                        </time>
                        <!-- /time publish -->

                        <hr class="hr-author">
                    </div>
                    <!-- /Author -->

                    <!-- Comments -->
                    <div id="hashover" class="comments-container mt-4">
                        <script src="{{ SITEURL }}/hashover-next/comments.php"></script>
                        <noscript>
                            <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>' %}
                                Lo siento, el sistema de comentarios no funciona sin JavaScript. Si
                                deseas, puedes {{ abre_enlace }} enviar tu comentario por correo
                                electrónico {{ cierra_enlace }}. El comentario será publicado en el espacio
                                reservado a comentarios de esta página.{% endtrans %}</p>
                        </noscript>
                    </div>
                    <!--End Comments -->

                </div>

                {% if SHOW_RECENT_POSTS %}

                    <div class="col-md-4">
                        <!-- article video 1 -->

                        {% for article in articles[:SHOW_RECENT_POSTS] %}
                            <article class="row justify-content-center align-items-center mt-1">
                                <!-- video next -->
                                <div class="col-md-6 mini">
                                    <a href="{{ SITEURL }}/{{ article.url }}">
                                        <div class="area">
                                            <div class="mask">

                                                <div class="vertical-align">
                                                    <i class="soumaicon play"><svg><use href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/svg/master.svg#play"/></svg></i>
                                                </div> <!-- End Vertical Align -->

                                            </div> <!-- End Mask / Hover -->

                                            {% if article.image %}
                                                <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/../wp-content/uploads/article/poster/{{ article.image }}" alt="{{ article.title }}" class="img-fluid">
                                            {% else %}
                                                <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/video.png" alt="video" class="img-fluid">
                                            {% endif %}

                                            {% if article.time %}
                                                <span class="duration">{{ article.time }}</span>
                                            {% else %}
                                                <span class="duration">{{ ('00:00') }}</span>
                                            {% endif %}

                                        </div> <!-- End Area -->
                                    </a>
                                </div>
                                <!-- video next -->

                                <!-- description -->
                                <div class="col-md-6">
                                    <h6><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="{{ _('Ver %(articulo)s', articulo=article.title|striptags) }}">{{ article.title }}</a></h6>
                                    {% include "article_info_aside.html" %}
                                </div>
                            </article>
                        {% endfor %}

                    </div>
                {% endif %}

            </div>
        </div>
    </div>
    <!-- End Main -->
{%- endblock -%}

{% block extend_js %}
    <!-- Plyr -->
    <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/modules/plyr/plyr.min.js"
            integrity="sha512-5LTPChkWfom9XmQ+T2/MfSTBirVqZf7g/7OM80kuLVcSg2aSzjVuivWhTWQaVA9B/V+fCtnLQuPoeXu3WoG4vA=="></script>
    <script src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/play.js"
            integrity="sha512-zI4q0i/VNK0C938doBn4Ptv7usRvFRpcodm8THoLOQm/2uUOH/HpeARUe9rINnm7nweYmfK4hcmnlPNUp2hxZw=="></script>
    <!-- /Plyr -->
{% endblock %}