]> git.ipfire.org Git - ipfire.org.git/commitdiff
wiki: Drop suggested size and replace with custom sizes
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Dec 2023 15:28:51 +0000 (15:28 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 20 Dec 2023 15:28:51 +0000 (15:28 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/wiki.py

index 53facb37868dba6f88c675020a079dfef23494dc..8d7601355e5019789b4760ae05d855e09c7861e2 100644 (file)
@@ -806,7 +806,7 @@ class WikiRenderer(misc.Object):
                        <div class="columns is-centered">
                                <div class="column is-8">
                                        <figure class="image modal-trigger" data-target="%(id)s">
-                                               <img src="/docs%(url)s" alt="%(caption)s">
+                                               <img src="/docs%(url)s?s=640&amp;%(args)s" alt="%(caption)s">
 
                                                <figcaption class="figure-caption">%(caption)s</figcaption>
                                        </figure>
@@ -816,7 +816,7 @@ class WikiRenderer(misc.Object):
 
                                                <div class="modal-content">
                                                        <p class="image">
-                                                               <img src="/docs%(plain_url)s?s=1920" alt="%(caption)s"
+                                                               <img src="/docs%(url)s?s=1920&amp;%(args)s" alt="%(caption)s"
                                                                        loading="lazy">
                                                        </p>
                                                </div>
@@ -850,9 +850,9 @@ class WikiRenderer(misc.Object):
                if not file or not file.is_image():
                        return "<!-- Could not find image %s in %s -->" % (url, self.path)
 
-               # Scale down the image if not already done
-               if not "s" in args:
-                       args["s"] = "920"
+               # Remove any requested size
+               if "s" in args:
+                       del args["s"]
 
                # Append arguments to the URL
                if args: