Skip to content

Commit

Permalink
Set image width/height, fix scaling of images, test viewport scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingrobot committed Jun 10, 2024
1 parent 58e848f commit 7ef65d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions themes/hyde-hyde-hyde-zola/sass/hyde-hyde/_print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ body {
}
img {
max-width: 100%;
height: auto;
}
blockquote,
ul {
Expand Down
1 change: 1 addition & 0 deletions themes/hyde-hyde-hyde-zola/sass/poole/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ a {
img {
display: block;
max-width: 100%;
height: auto;
margin: 0 0 1rem;
border-radius: 5px;
}
Expand Down
2 changes: 1 addition & 1 deletion themes/hyde-hyde-hyde-zola/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1" name="viewport"/>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=5" name="viewport"/>
<meta name="theme-color" content="#0d3a58"/>
<title>
{% block title %}
Expand Down
4 changes: 3 additions & 1 deletion themes/hyde-hyde-hyde-zola/templates/shortcodes/img.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<figure {% if align %}class={{ align }}{% endif %}>
{% if link %}<a href="{{ link }}">{% endif %}
<img src="{{ get_url(path=page.colocated_path ~ src) }}" {% if alt %}alt="{{ alt }}"{% elif caption %}alt="{{ text }}"{% endif %} style="max-width:100%">
{%- set image_path = page.colocated_path ~ src %}
{%- set image_meta = get_image_metadata(path=image_path) %}
<img width="{{ image_meta.width }}" height="{{ image_meta.height }}" src="{{ get_url(path=image_path) }}" {% if alt %}alt="{{ alt }}"{% elif caption %}alt="{{ text }}"{% endif %}>
{% if link %}</a>{% endif %}
{% if text %}
<figcaption>
Expand Down

0 comments on commit 7ef65d7

Please sign in to comment.