Skip to content
This repository has been archived by the owner on Jun 10, 2023. It is now read-only.

FIX - add alignment info to imgproc and figure shortcodes #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion layouts/shortcodes/figure.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{ if .Get "src" }}
<figure class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" >
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }}
class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" />
{{ if .Get "caption" }}
<figcaption class="{{ with .Get "captionPosition"}}{{ . }}{{ else -}} center {{- end }}" {{ with .Get "captionStyle" }} style="{{ . | safeCSS }}" {{ end }}>{{ .Get "caption" | markdownify }}</figcaption>
{{ end }}
Expand Down
5 changes: 3 additions & 2 deletions layouts/shortcodes/imgproc.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
src="{{ $image.RelPermalink }}"
width="{{ $image.Width }}"
height="{{ $image.Height }}"
class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}"
/>
{{ with .Inner }}
<figcaption>
{{ with .Inner }}
<figcaption class="{{ with $position }}{{ . }}{{ else -}} left {{- end }}">
{{ . }}
</figcaption>
{{ end }}
Expand Down