display image posts the same size as lemmy does

This commit is contained in:
rimu 2024-03-17 03:22:05 +13:00
parent 1cb31a0794
commit 5fc07c6604
3 changed files with 4 additions and 3 deletions

View file

@ -825,6 +825,7 @@ fieldset legend {
.post_image img {
max-width: 100%;
max-height: 90vh;
}
.render_username {

View file

@ -459,6 +459,7 @@ html {
.post_image {
img {
max-width: 100%;
max-height: 90vh;
}
}

View file

@ -32,11 +32,10 @@
<div class="post_image">
{% if post.image_id %}
{% if low_bandwidth %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc"><img src="{{ post.image.thumbnail_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"
width="{{ post.image.width }}" height="{{ post.image.height }}" /></a>
{% else %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc"><img src="{{ post.image.medium_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"
width="{{ post.image.width }}" height="{{ post.image.height }}" /></a>
{% else %}
<a href="{{ post.image.view_url() }}" rel="nofollow ugc"><img src="{{ post.image.view_url() }}" alt="{{ post.image.alt_text if post.image.alt_text else post.title }}"></a>
{% endif %}
{% else %}
<a href="{{ post.url }}" rel="nofollow ugc" target="_blank" aria-label="Go to image"><img src="{{ post.url }}" style="max-width: 100%; height: auto;" /></a>