fix avatar shortcode

master
David Kebler 2017-04-07 17:02:17 -07:00
parent f02ed87636
commit 9c4260d49e
3 changed files with 25 additions and 19 deletions

View File

@ -1,5 +1,9 @@
{{ $numOfParams := ( len .Params ) }}
{{ $avatar := "avatar.jpg" }}
{{ if eq $numOfParams 1 }}{{ $avatar := .Get 1 }}{{ end }}
<div class="box box--avatar">
{{ with .Get "link" }}<a href="{{.}}">{{ end }}
<img src="{{ .Page.Params.imagespath }}{{ .Get "filename" }}"/>
{{ with .Get "link" }}</a>{{ end }}
{{ if eq $numOfParams 2 }}<a href="{{.Get 1 }}">{{ end }}
{{ $path := "/images/" }} {{ with $.Site.Params.imagespath }} {{ $path := ( . ) }}{{ end }}
<img class="avatar" src="{{ $path }}{{ $avatar }}"/>
{{ if eq $numOfParams 2 }}</a>{{ end }}
</div>

View File

@ -129,6 +129,14 @@ img {
max-width: 100%;
}
img.avatar {
object-fit: cover;
border-radius: 50%;
width: 100px;
height: 100px;
padding: 0.5em;
}
figure {
display: block;
padding: 1em;

View File

@ -29,7 +29,7 @@
.section__content li {
font-size: 1em;
list-style-type: none;
line-height: 0.9em;
line-height: 1.1em;
}
.section__content ul,
@ -105,6 +105,8 @@
border-radius: 1em;
width: auto;
padding-bottom: 1em;
border-style: solid;
border-width: medium;
}
.section__headline--modal {
@ -129,7 +131,7 @@
overflow-y: auto;
position: relative;
align-items: flex-start;
font-size: 0.7em;
font-size: .9em;
padding: 1em;
}
@ -218,15 +220,6 @@
padding: 0.5em;
}
.box--avatar > img,
img.avatar {
object-fit: cover;
border-radius: 50%;
width: 100px;
height: 100px;
padding: 0.5em;
}
.highlight {
font-size: 0.7em;
align-items: left;
@ -303,24 +296,25 @@ img.avatar {
code {
font-size: 0.8em;
font-family: Inconsolata;
background-color: dimgrey;
background-color: black;
border-radius: 0.2em;
color: white;
padding-left: 0.2em;
padding-right: 0.2em;
padding-top: 0.05em;
padding-bottom: 0.05em;
padding-bottom: 0.3em;
}
code.hljs {
font-size: 0.75em;
border-radius: 0.2em;
background-color: dimgrey;
background-color: black;
color: white;
padding: 1em;
margin-bottom: 0.7em;
width: inherit;
max-width: 90vw;
border-width: 10px;
border-color: blue;
border-style: solid;
border-width: 3px;
border-color: dimgrey;
}