Improve image markup
This commit is contained in:
parent
7c1f5f900f
commit
52f3cfc3c2
2 changed files with 12 additions and 6 deletions
|
@ -1,10 +1,16 @@
|
|||
.md-img {
|
||||
margin: 3em;
|
||||
&.with-text { margin-bottom: .5em; }
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 3rem auto;
|
||||
img {
|
||||
border-radius: 1rem;
|
||||
margin: 0 auto;
|
||||
box-shadow: rgba(0, 0, 0, .25) 0 0 .5rem;
|
||||
}
|
||||
&.with-text img { margin-bottom: .5rem; }
|
||||
&-text {
|
||||
font-size: .8em;
|
||||
font-weight: 300;
|
||||
margin: 0 0 3em 0;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<p class="md-img {{ with .Text }}with-text{{ end }}">
|
||||
<figure class="md-img {{ with .Text }}with-text{{ end }}">
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}"{{ end }} loading="lazy" />
|
||||
</p>
|
||||
{{ with .Text }}<p class="md-img-text">{{ . }}</p>{{ end }}
|
||||
{{ with .Text }}<figcaption class="md-img-text">{{ . }}</figcaption>{{ end }}
|
||||
</figure>
|
Loading…
Reference in a new issue