Add smallimg shortcode for adding images that arent the full size
This commit is contained in:
11
layouts/shortcodes/smallimg.html
Normal file
11
layouts/shortcodes/smallimg.html
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<img src="{{ index .Params "src" }}"
|
||||||
|
{{- if isset .Params "alt" }} alt="{{ index .Params "alt"}}" {{ end -}}
|
||||||
|
class="small-img {{ if isset .Params "smartfloat" -}}
|
||||||
|
{{- if eq .Params.smartfloat "left" -}}
|
||||||
|
smartfloat-left
|
||||||
|
{{- else if eq .Params.smartfloat "right" -}}
|
||||||
|
smartfloat-right
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}"
|
||||||
|
{{- if isset .Params "width" }} style="width: {{ index .Params "width" }};" {{- end -}}
|
||||||
|
/>
|
||||||
@@ -282,6 +282,12 @@ strong {
|
|||||||
padding-right: 1.2rem !important;
|
padding-right: 1.2rem !important;
|
||||||
box-sizing: border-box !important;
|
box-sizing: border-box !important;
|
||||||
}
|
}
|
||||||
|
.small-img {
|
||||||
|
width: unset;
|
||||||
|
max-width: 100%;
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
.muted-text {
|
.muted-text {
|
||||||
color: #7A7B7C;
|
color: #7A7B7C;
|
||||||
}
|
}
|
||||||
@@ -297,9 +303,10 @@ h1, h2, h3, h4, h5, h6 {
|
|||||||
margin: 1.5em 0 0.7em 0;
|
margin: 1.5em 0 0.7em 0;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
margin: 1em 0;
|
margin: 1.5em 0;
|
||||||
}
|
}
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 0.3em solid #D1D1D1;
|
border-left: 0.3em solid #D1D1D1;
|
||||||
@@ -427,6 +434,14 @@ footer {
|
|||||||
.button {
|
.button {
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
}
|
}
|
||||||
|
.smartfloat-right {
|
||||||
|
float: right;
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
.smartfloat-left {
|
||||||
|
float: left;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
code {
|
code {
|
||||||
border-radius: 0.2rem;
|
border-radius: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user