Skip to content

Commit

Permalink
Optimisations pour la google search console video
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Feb 23, 2025
1 parent 9b9ce81 commit ff734f9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 50 deletions.
1 change: 1 addition & 0 deletions app/Resources/views/event/calendar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex,follow">
<title>Planning {{ event.title }}</title>

<!-- Bootstrap -->
Expand Down
69 changes: 19 additions & 50 deletions app/Resources/views/site/talks/show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,62 +9,37 @@
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
{% endblock %}

{% block javascripts %}
{{ parent() }}
<script>
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '315',
width: '530',
videoId: '{{ talk.youtubeId }}'
});
}
$('.transcript p').on('click', function(e) {
location.hash = "#player";
player.seekTo($(e.target).data('cueStart'));
})
</script>
{% endblock %}

{% block title %}{{ talk.title }} - {{ event.title }} - {{ parent() }}{% endblock %}
{% block title %}{{ talk.title }} - {{ event.title }}{% endblock %}

{% block metas %}
{{ parent() }}
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="AFUP - {{ talk.title }}">
<meta name="twitter:description" content="{{ talk.description|striptags|raw }}">
{% if talk.hasYoutubeId %}
<meta name="twitter:image:src" content="https://img.youtube.com/vi/{{ talk.getYoutubeId }}/hqdefault.jpg">
{% endif %}
<meta name="twitter:domain" content="afup.org">

<meta property="og:type" content="article" />
<meta property="og:title" content="AFUP - {{ talk.title }}" />
<meta property="og:type" content="video" />
<meta property="og:title" content="{{ talk.title }}" />
<meta property="og:url" content="{{ url('talks_show', {id: talk.id, slug: talk.slug }) }}" />
{% if talk.hasYoutubeId %}
<meta property="og:image" content="https://img.youtube.com/vi/{{ talk.getYoutubeId }}/hqdefault.jpg" />
{% endif %}
<meta property="og:description" content="{{ talk.description|striptags|raw }}" />
<meta property="og:site_name" content="AFUP" />
{% endblock %}

{% block content %}
<div class="mw1400p center" id="container">
<div class="container">
<div class="col-md-12 talk-title">
<div class="col-md-12">
<h1>{{ talk.title }}</h1>
</div>
</div>
{% if talk.hasYoutubeId %}
<div class="col-md-6">
<div class="responsive-video-container">
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ talk.youtubeId }}"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div>
</div>
{% endif %}

<div class="container">
<div class="col-md-{% if talk.hasYoutubeId %}6{% else %}12"{% endif %}">
<div class="container">
<div class="col-md-12">
Expand All @@ -78,7 +53,8 @@
</div>
<div class="container talk-date-container">
<div class="col-md-12">
Conférence donnée lors du <a href="{{ url('talks_list', {"fR": { "event.title" : [ event.title ]}}) }}">{{ event.title }}</a>, ayant eu lieu {% if event.dateStart == event.dateEnd %}le {{ event.dateStart|date('d') }}{% else %}les {{ event.dateStart|date('d') }} et {{ event.dateEnd|date('d') }}{% endif %} {{ event.dateEnd|localizeddate('none', 'none', 'fr', 'Europe/Paris', 'MMMM YYYY') }}.
Conférence donnée lors du <a href="{{ url('talks_list', {"fR": { "event.title" : [ event.title ]}}) }}">{{ event.title }}</a>,
ayant eu lieu {% if event.dateStart == event.dateEnd %}le {{ event.dateStart|date('d') }}{% else %}les {{ event.dateStart|date('d') }} et{{ event.dateEnd|date('d') }}{% endif %} {{ event.dateEnd|localizeddate('none', 'none', 'fr', 'Europe/Paris', 'MMMM YYYY') }}.
</div>
</div>
Expand Down Expand Up @@ -133,14 +109,6 @@
</div>
{% endif %}
</div>
{% if talk.hasYoutubeId %}
<div class="col-md-6">
<h2>Vidéo</h2>
<div class="responsive-video-container">
<div id="player"></div>
</div>
</div>
{% endif %}
</div>
<div class="container">
Expand Down Expand Up @@ -279,7 +247,8 @@
</div>
</div>
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}

0 comments on commit ff734f9

Please sign in to comment.