Closed paskal closed 5 years ago
Fixing rel
and target
is trivial:
--- ./themes/hugo-theme-jane/layouts/shortcodes/figure.html+0000
+++ ./fix/layouts/shortcodes/figure.html
@@ -15,7 +15,7 @@
<div class="img"{{ if .Parent }} style="background-image: url('{{ print $thumb }}');"{{ end }}{{ with .Get "size" }} data-size="{{.}}"{{ end }}>
<img itemprop="thumbnail" src="{{ $thumb }}" {{ with .Get "alt" | default (.Get "caption") }}alt="{{.}}"{{ end }}/><!-- <img> hidden if in .gallery -->
</div>
- {{ with .Get "link" | default (.Get "src") }}<a href="{{.}}" itemprop="contentUrl"></a>{{ end }}
+ {{ with .Get "link" | default (.Get "src") }}<a href="{{.}}"{{ with $.Get "target" }} target="{{.}}"{{ end }}{{ with $.Get "rel" }} rel="{{.}}"{{ end }} itemprop="contentUrl"></a>{{ end }}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>
{{- with .Get "title" }}<h4>{{.}}</h4>{{ end }}
However I'm not familiar enough with css to know how to fix height
.
We fixed everything expect height, which might be not needed with auto-width option. Please reopen if needed, my problem is solved and I'm resolving this issue.
Hugo's figure.html is different from this theme figure.html: it supports
caption-effect
,caption-position
,figurecount
,size
,thumb
parameters, but doesn't supportheight
,rel
andtarget
. To be truly backwards compatible we should add missing parameters support to this themefigure.html
template.