Skip to content

Commit

Permalink
Fix the side-image shortcode + add options caption and floating
Browse files Browse the repository at this point in the history
  • Loading branch information
gmantele committed Oct 16, 2024
1 parent 6ffd1e0 commit 898f40f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions layouts/shortcodes/side-image.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
{{- if (.Get "floating" )}}
<section class="with-image is-floating">
<figure class="floating {{ .Get "position" }}">
{{- if (.Get "thumbnail") }}
<a class="floating {{ .Get "position" }}" href="{{ .Get "image" }}"><img src="{{- .Get "thumbnail" }}" /></a>
<a href="{{ .Get "image" }}"><img src="{{- .Get "thumbnail" }}" /></a>
{{- else }}
<img class="floating {{ .Get "position" }}" src="{{- .Get "image" }}" />
<img src="{{- .Get "image" }}" />
{{- end }}
{{- with (.Get "caption") }}
<figcaption>{{ . | markdownify }}</figcaption>
{{- end }}
</figure>
{{- .Inner | markdownify }}
</section>
{{- else }}
<section class="with-image {{ .Get "position" }}">
<aside>
<figure>
{{- if (.Get "thumbnail") }}
<a href="{{ .Get "image" }}"><img src="{{- .Get "thumbnail" }}" /></a>
{{- else }}
<img src="{{- .Get "image" }}" />
{{- end }}
</aside>
{{- with (.Get "caption") }}
<figcaption>{{ . | markdownify }}</figcaption>
{{- end }}
</figure>
<main>
{{- .Inner | markdownify }}
</main>
Expand Down

0 comments on commit 898f40f

Please sign in to comment.