{{ $pic := "solo" }}
{{ $text := "solo" }}
{{- if and (.context.Resources.ByType "image") (.context.Content) -}}
    {{ $pic = "multiple_small" }}
    {{ $text = "multiple_big" }}
{{ end }}
{{ $img := "" }}
{{ $thumb := "" }}
{{- if .context.Resources.ByType "image" -}}
    {{- $img = index (.context.Resources.ByType "image") 0 -}}
    {{- $thumb = $img.Resize "1024x" }}
    {{ if .content }}
        {{- $thumb = $img.Resize "500x" }}
    {{ end }}
{{ end }}

<section>
 <div class="articleinner">
    {{ if and (ne $img "") (eq .pic true)}}
         <div class="articlepicture {{ $pic }}">
            {{ if and (ne .type "list") (.context.Resources.ByType "image") }}<a href="{{- $img.Permalink -}}">{{ end }}
                <img src="{{- $thumb.Permalink -}}" class="borderrad4px" />
            {{ if ne .type "list" }}</a>{{ end }}
            {{ if eq .type "article" }}{{ end }}
        </div>
    {{ end }}
    <div class="articletext {{ $text }}">
        {{ if .partial_before }}
            {{ partial .partial_before (dict "context" .context "pic" .pic) }}
        {{ end }}
        {{ .content }}
    </div>
</div>
</section>
