add fallback for older previews
This commit is contained in:
@@ -181,7 +181,12 @@
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 33.3vw
|
||||
height: 33.3vw;
|
||||
|
||||
&.has-cropped-false {
|
||||
width: 33.3vw;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class PostPresenter < Presenter
|
||||
html << %{<picture>}
|
||||
html << %{<source media="(max-width: 660px)" srcset="#{cropped_src}">}
|
||||
html << %{<source media="(min-width: 660px)" srcset="#{post.preview_file_url}">}
|
||||
html << %{<img itemprop="thumbnailUrl" src="#{post.preview_file_url}" title="#{h(tooltip)}" alt="#{h(post.tag_string)}">}
|
||||
html << %{<img itemprop="thumbnailUrl" class="has-cropped-#{post.has_cropped?}" src="#{post.preview_file_url}" title="#{h(tooltip)}" alt="#{h(post.tag_string)}">}
|
||||
html << %{</picture>}
|
||||
html << %{</a>}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user