Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions _includes/responsive-file.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="responsive-file-container">
<figure class="responsive-file-figure" style="max-width: {{ include.width | default: '100%' }}; margin-left: auto; margin-right: auto;">
<div class="responsive-file-container">
{% if include.type == "video" %}
<video controls width="100%" preload="metadata">
<source src="{{ include.url }}" type="{{ include.format | default: 'video/mp4' }}">
Expand All @@ -18,4 +19,8 @@
<a href="{{ include.url }}" download>{{ include.filename | default: "Download File" }}</a>
</div>
{% endif %}
</div>
</div>
{% if include.caption %}
<figcaption class="responsive-file-caption">{{ include.caption }}</figcaption>
{% endif %}
</figure>
9 changes: 7 additions & 2 deletions _includes/youtube.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<!-- _includes/youtube.html -->
<div class="youtube-container">
<figure class="responsive-file-figure" style="max-width: {{ include.width | default: '100%' }}; margin-left: auto; margin-right: auto;">
<div class="youtube-container">
<iframe
src="https://www.youtube.com/embed/{{ include.id }}"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
</div>
</div>
{% if include.caption %}
<figcaption class="responsive-file-caption">{{ include.caption }}</figcaption>
{% endif %}
</figure>
22 changes: 22 additions & 0 deletions _styles/responsive-files.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
---
---
.responsive-file-figure {
width: 100%;
margin: 2rem 0;
display: block;
}

// caption style
.responsive-file-caption {
margin-top: 0.75rem;
text-align: center;
font-size: 0.9rem;
color: #555;
line-height: 1.4;
padding: 0 1rem;
}

// dark mode
@media (prefers-color-scheme: dark) {
.responsive-file-caption {
color: #aaa;
}
}

.responsive-file-container {
position: relative;
Expand Down