% (address, alias or address)
def _render_image(self, m):
- url, text = m.groups()
+ url, caption = m.groups()
# Skip any absolute and external URLs
if url.startswith("/") or url.startswith("https://") or url.startswith("http://"):
- return """<img src="%s" alt="%s">""" % (url, text or "")
+ return """<figure class="figure"><img src="%s" class="figure-img img-fluid rounded" alt="%s">
+ <figcaption class="figure-caption">%s</figcaption></figure>
+ """ % (url, url, caption or "")
# Try to split query string
url, delimiter, qs = url.partition("?")
# Scale down the image if not already done
if not "s" in args:
- args["s"] = "768"
+ args["s"] = "940"
- return """<a href="%s?action=detail"><img src="%s?%s" alt="%s"></a>""" \
- % (url, url, urllib.parse.urlencode(args), text or "")
+ return """<figure class="figure"><img src="%s?%s" class="figure-img img-fluid rounded" alt="%s">
+ <figcaption class="figure-caption">%s</figcaption></figure>
+ """ % (url, urllib.parse.urlencode(args), caption, caption or "")
def render(self, text):
logging.debug("Rendering %s" % self.path)