mirror of
https://github.com/zensical/zensical.git
synced 2026-05-04 10:00:45 +00:00
fix: error when setting caption_position on glightbox extension (#604)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
@@ -124,10 +124,12 @@ class GlightboxTreeprocessor(TreeprocessorExt):
|
||||
el.set("data-description", description)
|
||||
|
||||
# Set image description position
|
||||
if caption_position := (
|
||||
img.get("data-caption-position")
|
||||
or self.config.get("caption_position")
|
||||
):
|
||||
if (
|
||||
caption_position := (
|
||||
img.get("data-caption-position")
|
||||
or self.config.get("caption_position")
|
||||
)
|
||||
) and caption_position != "bottom":
|
||||
el.set("data-desc-position", str(caption_position))
|
||||
|
||||
# Set gallery grouping
|
||||
@@ -258,7 +260,7 @@ class GlightboxExtension(ExtensionExt):
|
||||
"Use img alt attribute as the caption when no title is set.",
|
||||
],
|
||||
"caption_position": [
|
||||
None,
|
||||
"bottom",
|
||||
"Default caption position: bottom, top, left, or right.",
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user