Extract resize height and width to env variables & switch to 750px width
This commit is contained in:
parent
de360cf100
commit
99b5f9544e
3 changed files with 6 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
body {
|
||||
max-width: 640px;
|
||||
/* Overriding so that it doesn't change even when updating the library. */
|
||||
max-width: 750px;
|
||||
}
|
||||
|
||||
footer {
|
||||
|
|
|
@ -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}"]
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Reference in a new issue