diff --git a/articles/static/public.css b/articles/static/public.css index 0e0f28a..b2c00a2 100644 --- a/articles/static/public.css +++ b/articles/static/public.css @@ -1,5 +1,6 @@ body { - max-width: 640px; + /* Overriding so that it doesn't change even when updating the library. */ + max-width: 750px; } footer { diff --git a/attachments/models.py b/attachments/models.py index 81c8da3..5e93cf0 100644 --- a/attachments/models.py +++ b/attachments/models.py @@ -64,8 +64,8 @@ class Attachment(models.Model): post_data = { "lossy": 1, "resize": 3, - "resize_width": 640, - "resize_height": 10000, + "resize_width": settings.SHORTPIXEL_RESIZE_WIDTH, + "resize_height": settings.SHORTPIXEL_RESIZE_HEIGHT, "keep_exif": 1, "file_paths": json.dumps( [f"{self.original_file.name}:{self.original_file.path}"] diff --git a/blog/settings.py b/blog/settings.py index a0d7901..0feffc9 100644 --- a/blog/settings.py +++ b/blog/settings.py @@ -187,6 +187,8 @@ BLOG = { } SHORTPIXEL_API_KEY = os.getenv("SHORTPIXEL_API_KEY") +SHORTPIXEL_RESIZE_WIDTH = int(os.getenv("SHORTPIXEL_RESIZE_WIDTH", 750)) +SHORTPIXEL_RESIZE_HEIGHT = int(os.getenv("SHORTPIXEL_RESIZE_HEIGHT", 10000)) PLAUSIBLE_DOMAIN = os.getenv("PLAUSIBLE_DOMAIN")