Extract resize height and width to env variables & switch to 750px width

This commit is contained in:
Gabriel Augendre 2020-12-27 19:23:32 +01:00
parent de360cf100
commit 99b5f9544e
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
body {
max-width: 640px;
/* Overriding so that it doesn't change even when updating the library. */
max-width: 750px;
}
footer {

View file

@ -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}"]

View file

@ -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")