aboutsummaryrefslogtreecommitdiff
path: root/templates/shortcodes
diff options
context:
space:
mode:
Diffstat (limited to 'templates/shortcodes')
-rw-r--r--templates/shortcodes/imagehover.html21
-rw-r--r--templates/shortcodes/vm.html2
-rw-r--r--templates/shortcodes/yt.html2
3 files changed, 18 insertions, 7 deletions
diff --git a/templates/shortcodes/imagehover.html b/templates/shortcodes/imagehover.html
index 68f25be..99dd4e4 100644
--- a/templates/shortcodes/imagehover.html
+++ b/templates/shortcodes/imagehover.html
@@ -8,22 +8,33 @@
{%- else %}
<div id="{{ sourcename }}">## {{ sourcename }} </div>
- <a onmouseover="document.getElementById('{{ sourcename }}').innerHTML='{{ bgname }}';" onmouseout="document.getElementById('{{ sourcename }}').innerHTML='{{ sourcename }}';" href="#"><div id="{{ sourcename }}image"> </div></a>
+ <div id="{{ sourcename }}image" alt="{{ sourcename }}"> </div>
{%- endif %}
{%- endfor %}
+{%- if w and h and p %}
+ {%- set padding = h / w * p %}
+{%- elif w and h %}
+ {%- set padding = h / w * 50 %}
+{%- else %}
+ {%- set padding = 50 %}
+{%- endif %}
+
<style>
{%- for source in sources %}
{%- set sourcename = source | split(pat=".") | first %}
{%- if not loop.first %}
#{{ sourcename | safe }}image {
- background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ source | safe }}');
- width: 560px;
- height: 650px;
+ background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ bg | safe }}');
+ background-size: contain;
+ background-repeat: no-repeat;
+ width: {{ p | default(value=50) }}%;
+ height: 0;
+ padding-top: {{ padding }}%;
}
#{{ sourcename | safe }}image:hover {
- background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ bg | safe }}');
+ background-image: url('{{ get_url(path="/", trailing_slash=false) }}{{ page.path | safe }}{{ source | safe }}');
}
{%- endif %}
{%- endfor %}
diff --git a/templates/shortcodes/vm.html b/templates/shortcodes/vm.html
index 230e557..70230fe 100644
--- a/templates/shortcodes/vm.html
+++ b/templates/shortcodes/vm.html
@@ -1,3 +1,3 @@
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
- <iframe src="https://player.vimeo.com/video/{{id}}" style="position:absolute;top:0;left:0;"></iframe>
+ <iframe src="https://player.vimeo.com/video/{{id}}" title="{{title | default(value="Vimeo") }}" style="position:absolute;top:0;left:0;"></iframe>
</div>
diff --git a/templates/shortcodes/yt.html b/templates/shortcodes/yt.html
index 7816bd8..9ee9d1f 100644
--- a/templates/shortcodes/yt.html
+++ b/templates/shortcodes/yt.html
@@ -1,3 +1,3 @@
<div style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
- <iframe src="https://www.youtube.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" style="position:absolute;top:0;left:0;"></iframe>
+ <iframe src="https://www.youtube.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" title="{{title | default(value="Youtube") }}" style="position:absolute;top:0;left:0;"></iframe>
</div>