Add a section shortcode to enable wrapping a chunk of a post in a <section> Add a section.flow class that removes grid from the section Fix up the about styles so that the paragraph that Hugo wraps the <img> in behaves sensibly when floated Fix the alt text in the circular_image shortcode
12 lines
482 B
HTML
12 lines
482 B
HTML
{{- $img := (.Page.Resources.GetMatch (.Get "name")) -}}
|
|
{{- $id := .Get "id" -}}
|
|
{{- $classes := .Get "class" -}}
|
|
{{- $alt := .Get "alt" | default $img.Params.alt -}}
|
|
{{- $width := .Get "width" -}}
|
|
{{- $resized_img := $img.Resize (printf "%dx%d" $width $width) -}}
|
|
<img
|
|
{{ with $id }}id="{{ . }}"{{ end }}
|
|
class="circular{{ with $classes }} {{ . }}{{ end }}"
|
|
src="{{ $img.RelPermalink }}"
|
|
{{ with $alt }}alt="{{ . }}"{{ end }}
|
|
width="{{ $width }}" height="{{ $width }}">
|