Add image shortcode

This commit is contained in:
panr 2018-12-12 19:55:37 +01:00
parent c9f720e77d
commit 8e2e37eece
3 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,3 @@
{{ if .Get "src" }}
<img src="{{ .Get "src" | safeURL }}" {{ with .Get "alt" }} alt="{{ . | plainify }}" {{ end }} class="{{ with .Get "position"}}{{ . }}{{ else -}} left {{- end }}" {{ with .Get "style" }} style="{{ . | safeCSS }}" {{ end }} />
{{ end }}

View File

@ -79,6 +79,19 @@ a {
img {
display: block;
max-width: 100%;
&.left {
margin-right: auto;
}
&.center {
margin-left: auto;
margin-right: auto;
}
&.right {
margin-left: auto;
}
}
code {

File diff suppressed because one or more lines are too long