Skip to content

Commit

Permalink
Also change the defaults in pelican.settings
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Oct 12, 2023
1 parent b6edcd2 commit dbb17d6
Showing 1 changed file with 51 additions and 12 deletions.
63 changes: 51 additions & 12 deletions pelican/plugins/photos/photos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1537,28 +1537,34 @@ def initialized(pelican: Pelican):
DEFAULT_CONFIG.setdefault(
"PHOTO_GALLERY",
{
"width": 1024,
"height": 768,
"type": "jpeg",
"options": {"quality": 80},
"default": {
"width": 1024,
"height": 768,
"type": "jpeg",
"options": {"quality": 80},
}
},
)
DEFAULT_CONFIG.setdefault(
"PHOTO_ARTICLE",
{
"width": 760,
"height": 506,
"type": "jpeg",
"options": {"quality": 80},
"default": {
"width": 760,
"height": 506,
"type": "jpeg",
"options": {"quality": 80},
}
},
)
DEFAULT_CONFIG.setdefault(
"PHOTO_THUMB",
{
"width": 192,
"height": 144,
"type": "jpeg",
"options": {"quality": 60},
"default": {
"width": 192,
"height": 144,
"type": "jpeg",
"options": {"quality": 60},
}
},
)
DEFAULT_CONFIG.setdefault("PHOTO_SQUARE_THUMB", False)
Expand All @@ -1581,6 +1587,39 @@ def initialized(pelican: Pelican):

if pelican:
pelican.settings.setdefault("PHOTO_LIBRARY", p)
pelican.settings.setdefault(
"PHOTO_GALLERY",
{
"default": {
"width": 1024,
"height": 768,
"type": "jpeg",
"options": {"quality": 80},
}
},
)
pelican.settings.setdefault(
"PHOTO_ARTICLE",
{
"default": {
"width": 760,
"height": 506,
"type": "jpeg",
"options": {"quality": 80},
}
},
)
pelican.settings.setdefault(
"PHOTO_THUMB",
{
"default": {
"width": 192,
"height": 144,
"type": "jpeg",
"options": {"quality": 60},
}
},
)
pelican.settings.setdefault("PHOTO_GALLERY", (1024, 768, 80))
pelican.settings.setdefault("PHOTO_ARTICLE", (760, 506, 80))
pelican.settings.setdefault("PHOTO_THUMB", (192, 144, 60))
Expand Down

0 comments on commit dbb17d6

Please sign in to comment.