New shortcode, uses JS (sadly) but at least it doesn't break the
RSS feed
This commit is contained in:
parent
424c2b73ff
commit
a67da2b6ff
2 changed files with 9 additions and 26 deletions
|
@ -70,4 +70,11 @@
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
<script src="{{ "js/baguetteBox.min.js" | relURL}}" rel="application/javascript"></script>
|
||||||
|
<script>baguetteBox.run('figure', {
|
||||||
|
captions: function(element) {
|
||||||
|
return element.getElementsByTagName('img')[0].title;
|
||||||
|
}
|
||||||
|
});</script>
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,37 +5,13 @@
|
||||||
{{ $imagethumbnail := $image.Resize $options }}
|
{{ $imagethumbnail := $image.Resize $options }}
|
||||||
|
|
||||||
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||||
|
<a href="{{ $image.RelPermalink }}">
|
||||||
<a href="#{{ $image.RelPermalink | md5 }}-img">
|
<img class="thumbnail" src="{{ $imagethumbnail.RelPermalink }}"
|
||||||
<img src="{{ $imagethumbnail.RelPermalink }}"
|
|
||||||
{{- if or (.Get "alt") (.Get "caption") }}
|
{{- if or (.Get "alt") (.Get "caption") }}
|
||||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<figure id="{{ $image.RelPermalink | md5 }}-img" class="lbox fade">
|
|
||||||
<img src="{{ $image.RelPermalink }}" {{- if or (.Get "alt") (.Get "caption") }}
|
|
||||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
|
||||||
{{- end -}}
|
|
||||||
/>
|
|
||||||
<a href="#_"></a>
|
|
||||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
|
||||||
<figcaption>
|
|
||||||
{{ with (.Get "title") -}}
|
|
||||||
<h5>{{ . }}</h5>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if or (.Get "caption") (.Get "attr") -}}<p class="f5 center">
|
|
||||||
{{- .Get "caption" | markdownify -}}
|
|
||||||
{{- with .Get "attrlink" }}
|
|
||||||
<a href="{{ . }}">
|
|
||||||
{{- end -}}
|
|
||||||
{{- .Get "attr" | markdownify -}}
|
|
||||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
|
||||||
{{- end }}
|
|
||||||
</figcaption>
|
|
||||||
{{- end }}
|
|
||||||
</figure>
|
|
||||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||||
<figcaption class="center">
|
<figcaption class="center">
|
||||||
{{ with (.Get "title") -}}
|
{{ with (.Get "title") -}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue