Skip to content

Commit

Permalink
Formato video links OK
Browse files Browse the repository at this point in the history
  • Loading branch information
elswork committed Dec 8, 2023
1 parent 1d14a62 commit 32a1ef4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
8 changes: 5 additions & 3 deletions content/links/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ eleventyNavigation:
<div class="links-container">
{% for link in links %}
<div class="link-item">
{% if link.url and (link.url.includes('youtube.com') or link.url.includes('youtu.be')) %}
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{ link.url | youtubeID }}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
{% else %}
<a href="{{ link.url }}" target="_blank" class="link-title">{{ link.title }}</a>
<p class="link-description">{{ link.description }}</p>
{% if link.url and (link.url.includes('youtube.com') or link.url.includes('youtu.be')) %}
<div class="video-container">
<iframe src="https://www.youtube.com/embed/{{ link.url | youtubeID }}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
{% else %}
<div class="gallery">
<button class="gallery-prev">◀</button>
<button class="gallery-next">▶</button>
Expand Down
15 changes: 15 additions & 0 deletions public/css/bundle.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,18 @@ footer p {
right: 10px;
}

.video-container {
position: relative;
width: 100%; /* O un ancho máximo específico si lo prefieres */
padding-top: 56.25%; /* Proporción para vídeos de YouTube (16:9) */
margin: 15px 0;
}

.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

0 comments on commit 32a1ef4

Please sign in to comment.