{{ define "main" }}

{{if (isset .Params "titleimg")}}
{{$titleimg := resources.Get .Params.titleimg}}
<div class="bg-primary p-t-100  p-b-100 ta-c">
    <img class="max-w-300" src="{{$titleimg.Permalink}}" alt="{{.Title}}" />
</div>
{{end}}

<div class="container flex-row j-center wrap p-30">
    {{range .Pages}}
    <a href="{{.Permalink}}">
        <div class="max-w-250 flex-1 m-20">
            {{ if (isset .Params "featuredimage" )}}
            {{$img := resources.Get .Params.featuredimage}}
            <div style='background-image: url({{ $img.Permalink }}); background-size: cover; background-position: center center;' class="bg-bubble w-150 h-150 m-auto"></div>
            {{end}}
            <h3 class="primary ta-c">{{.Title}}</h3>
            <p class="ta-c" style="font-size: 0.8em; text-style: italic;">Le {{dateFormat "02/01/2006" .Date}}</p>
            <p class="ta-j">{{.Description}}</p>
        </div>
    </a>
    {{end}}
</div>

{{end}}