{{- partial "head.html" . }}
{{- partial "header.html" . }}

<div class="container center mt-3 mb-3">
    {{- partial "carousel.html" . }}
</div>

<!-- welcome -->
<div class="container">
    {{- partial "welcome.html" . }}
</div>
<!-- welcome end -->

<main>
<div class="container">
        <div class="row">
            <!-- Articles Section -->
            <div class="col-md-9">
                {{- $counter := 0 }}
                {{- $pages := .Site.RegularPages }}
                {{- $recentpostlimit := (sub now.Unix 2592000 ) }}
                {{- range first 5 $pages }}
                {{- $counter = add $counter 1 }}
                {{- if eq $counter 1 }}
                <!-- First Post -->
                <div class="card border-primary mb-3">
                    <div class="card-header">
                        <h3 class="card-title"><a href="{{.Permalink}}">{{ .Title }}</a></h3>
                            <small>{{- dateFormat "02/01/2006" .Date }}</small>
                            {{ if lt $recentpostlimit .Date.Unix }}
                            <span class="badge bg-secondary">Nέο</span>
                        {{ end }}
                    </div>
                    <div class="card-body">
                        <p class="card-text">
                        {{- .Summary | plainify | safeHTML }}
                        </p>
                        <a href="{{.Permalink}}" class="btn btn-primary btn-sm">Περισσότερα...</a>
                    </div>
                </div>
                <!-- First Post End -->
                {{- else }}
                <div class="card mb-2">
                    <div class="card-header">
                    <h4 class="card-title"><a href="{{.Permalink}}">{{ .Title }}</a></h4>
                    <small class="text-body-secondary">{{- dateFormat "02/01/2006" .Date }}</small>
                    {{ if lt $recentpostlimit .Date.Unix }}
                        <span class="badge bg-secondary">Nέο</span>                  
                    {{- end }}
                    </div>
                    <div class="card-body">
                        <p class="card-text">
                        {{- .Summary | plainify | safeHTML }}
                        </p>
                        <a href="{{.Permalink}}" class="btn btn-primary btn-sm"></span>Περισσότερα...</a>
                    </div>
                </div>
                {{- end}}
                {{- end }}
                <div class="mx-auto p-2" style="width: 250px;"><button class="btn btn-sm btn-link"><a href={{- relref . "/posts/" }}>Παλαιότερες δημοσιεύσεις</a></button></div>
            </div>
            <!-- End Articles Section -->

            <!-- Column 2 start -->
            {{- partial "column2.html" . }}
            <!-- Column 2 end -->
        </div>
</div>
</main>
<!-- Footer Start -->
{{ partial "footer.html" . }}
<!-- Footer End -->

