mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-15 04:45:08 +01:00
Add image shortcode
This commit is contained in:
parent
7a9b33a9b1
commit
0a4730452c
3
layouts/shortcodes/image.html
Normal file
3
layouts/shortcodes/image.html
Normal 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 }}
|
@ -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
Loading…
Reference in New Issue
Block a user