Add image shortcode

This commit is contained in:
panr 2018-12-12 19:55:37 +01:00
parent 7a9b33a9b1
commit 0a4730452c
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 { img {
display: block; display: block;
max-width: 100%; max-width: 100%;
&.left {
margin-right: auto;
}
&.center {
margin-left: auto;
margin-right: auto;
}
&.right {
margin-left: auto;
}
} }
code { code {

File diff suppressed because one or more lines are too long