Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
% (address, alias or address)
def _render_image(self, m):
% (address, alias or address)
def _render_image(self, m):
+ url, caption = m.groups()
# Skip any absolute and external URLs
if url.startswith("/") or url.startswith("https://") or url.startswith("http://"):
# 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("?")
# Try to split query string
url, delimiter, qs = url.partition("?")
# Scale down the image if not already done
if not "s" in args:
# Scale down the image if not already done
if not "s" in args:
- 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)
def render(self, text):
logging.debug("Rendering %s" % self.path)
font-size: $h6-font-size;
}
font-size: $h6-font-size;
}
- img {
- @include img-fluid;
-
- // Center all images
- display: block;
- margin-left: auto;
+ figure {
+ // Center images
+ display: table;
// Add some extra margin to the top & bottom
padding: ($spacer * 2) 0 ($spacer * 2) 0;
// Add some extra margin to the top & bottom
padding: ($spacer * 2) 0 ($spacer * 2) 0;