Skip to content

Commit

Permalink
Merge pull request #1321 from ubyssey/change-images-back-to-jpg
Browse files Browse the repository at this point in the history
changed webp to onthefly, commented out creepy mixpanel
  • Loading branch information
SamuelmdLow authored Oct 21, 2023
2 parents 8f58f53 + d37c7fd commit a50f22d
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion archive/templates/archive/objects/article_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="o-article__left">
<a class="o-article__image" href="{% pageurl article %}">
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-340x238-c100 %}
{% image article.featured_media.first.image fill-340x238-c100 format-webp %}
{% elif article.featured_media.first.video %}
<img src="http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg"
alt="Thumbnail" />
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/author_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="author_card">
{% if author.author.image and author.author.display_image %}
<div class="author_image_container">
{% image author.author.image width-200 class="author_image" %}
{% image author.author.image width-200 format-webp class="author_image" %}
</div>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/author_pinned.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="o-article__left">
<a class="o-article__image" href={% pageurl article %}>
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-340x238-c100 %}
{% image article.featured_media.first.image fill-340x238-c100 format-webp %}
{% else %}
<img src="http://img.youtube.com/vi/{{ article.featured_video.video.url|youtube_embed_id|safe }}/0.jpg" alt=""/>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/blog_column-latest.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% if article.featured_media.first %}
{% if article.featured_media.first.image %}
<a class="o-article__image" href="{% pageurl article %}">
{% image article.featured_media.first.image fill-250x250-c100 %}
{% image article.featured_media.first.image fill-250x250-c100 format-webp %}
</a>
{% elif article.featured_media.first.video %}
<a class="o-article__image" href="{% pageurl article %}" style="background-image: url('http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg'); background-size: contain; background-repeat: no-repeat"></a>
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/blog_column.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{% if article.featured_media.first %}
{% if article.featured_media.first.image %}
<a class="o-article__image" href="{% pageurl article %}">
{% image article.featured_media.first.image fill-250x250-c100 %}
{% image article.featured_media.first.image fill-250x250-c100 format-webp %}
</a>
{% elif article.featured_media.first.video %}
<a class="o-article__image" href="{% pageurl article %}" style="background-image: url('http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg'); background-size: contain; background-repeat: no-repeat"></a>
Expand Down
4 changes: 2 additions & 2 deletions article/templates/article/objects/cover_story.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<div class="o-article__left">
<a class="o-article__image" href={% pageurl article %}>
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-661x462-c100 %}
{% image article.featured_media.first.image fill-661x462-c100 format-webp %}
{% elif article.featured_media.first.video %}
<img src="http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg" alt=""/>
{% else %}
{% image article.featured_media fill-661x462-c100 %}
{% image article.featured_media fill-661x462-c100 format-webp %}
{% endif %}
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="o-article__left">
<a class="o-article__image" href={% pageurl article %}>
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-340x238-c100 %}
{% image article.featured_media.first.image fill-340x238-c100 format-webp %}
{% else %}
<img src="http://img.youtube.com/vi/{{ article.featured_video.video.url|youtube_embed_id|safe }}/0.jpg" alt=""/>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/featured_media.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% with featured_media.first as featured_image_object %}
<div class="featured-media">
{% image featured_image_object.image original as original_image %}
{% image featured_image_object.image width-500 as featured_image %}
{% image featured_image_object.image width-500 format-webp as featured_image %}
<img class="article-attachment"
data-id="{{ featured_image_object.id }}"
data-caption="{% if featured_image_object.caption %}{{ featured_image_object.caption }}{% endif %}"
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/infinitefeed_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="o-article__left">
<div style="position:relative">
<a href="{% pageurl article %}" class="o-article__image" style="border-color:{{article|get_colour}}">
{% image article.featured_media.first.image fill-340x238-c100 %}
{% image article.featured_media.first.image fill-340x238-c100 format-webp %}
</a>
{% if label %}
{% if article|get_label %}
Expand Down
2 changes: 1 addition & 1 deletion article/templates/article/objects/top_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% if article.featured_media.first %}
<a class="o-article__image" href="{% pageurl article %}">
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-250x250-c100 %}
{% image article.featured_media.first.image fill-250x250-c100 format-webp %}
{% elif article.featured_media.first.video %}
<img src='http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg'>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion authors/templates/authors/author_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<div class="author-header">
{% if self.image %}
{% image self.image width-350 as pfp %}
{% image self.image width-350 format-webp as pfp %}
<div class="author-img" style="background-image: url('{{pfp.full_url}}')"></div>
{% endif %}
<div class="author-info">
Expand Down
6 changes: 0 additions & 6 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,6 @@

WAGTAILIMAGES_IMAGE_MODEL = 'images.UbysseyImage'

WAGTAILIMAGES_FORMAT_CONVERSIONS = {
'png': 'webp',
'jpeg': 'webp',
'bmp': 'webp',
'webp': 'webp',
}

# wagtailmenus settings
WAGTAILMENUS_ACTIVE_CLASS = 'current' # used for css in e.g. navigation/header.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if self.link %}
<a href={{ self.link }}>
{% endif %}
{% image self.image width-320 %}
{% image self.image width-320 format-webp %}
{% if self.link %}
</a>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a href={{ self.link }}>
<h4 class="issueText">{{ self.date }}</h4>
{% if self.show_image and self.image %}
{% image self.image width-350 as mag %}
{% image self.image width-350 format-webp as mag %}
<img class="issue_img" src="{{mag.url}}">
{% endif %}
</a>
Expand Down
12 changes: 6 additions & 6 deletions ubyssey/static_src/src/js/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as mp from './modules/Mixpanel';
// import * as mp from './modules/Mixpanel'; //commented out because creepy af
import upcomingEvents from './widgets/upcoming-events';

// self-executing js anonymous function
Expand All @@ -23,11 +23,11 @@ import upcomingEvents from './widgets/upcoming-events';
//initializeGallery()

// Track page views through Mixpanel (for articles & for non-article pages)
if ($('.js-article').length) {
mp.pageView('article', $('.js-article'), 1) // article pages
} else {
mp.pageView(); // non-article pages
}
//if ($('.js-article').length) {
// mp.pageView('article', $('.js-article'), 1) // article pages
//} else {
// mp.pageView(); // non-article pages
//}

//listeners for magazine & culture dropdowns in mobile header pop up
$('#magazine-mobile').click(function () {
Expand Down
5 changes: 0 additions & 5 deletions ubyssey/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

urlpatterns = []

settings.WAGTAILIMAGES_FORMAT_CONVERSIONS = {
'jpeg': 'webp',
'png': 'webp',
'webp': 'webp',
}

if settings.DEBUG:
import debug_toolbar
Expand Down

0 comments on commit a50f22d

Please sign in to comment.