59 lines
1.8 KiB
HTML
59 lines
1.8 KiB
HTML
{{ define "main" }}
|
|
|
|
<!-- recent post -->
|
|
<section class="section-sm">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-8 mb-100 mb-lg-0">
|
|
<h3 class="section-header">{{ i18n "lastPosts" }}</h3>
|
|
{{ range first 5 (where .Site.RegularPages "Type" "blog") }}
|
|
<article class="posts featured-post">
|
|
<div class="row mb-20">
|
|
|
|
{{ if .Params.Image }}
|
|
{{ $article := .Permalink | relURL }}
|
|
{{ $image := .Params.Image | relURL }}
|
|
<div class="col-md-4">
|
|
<img src="{{ print $article $image }}" class="posts-img" alt="{{ .Title | markdownify }}">
|
|
</div>
|
|
<div class="col-md-7">
|
|
{{ else }}
|
|
<div class="col-md-10">
|
|
{{ end }}
|
|
|
|
<div class="card-body pt-0">
|
|
{{ range .Params.Categories }}
|
|
<a href="{{ `categories/` | relLangURL }}{{ . | urlize | lower }}" class="text-primary">{{ . | title
|
|
| humanize }}</a>
|
|
{{ end }}
|
|
<a href="{{ .Permalink }}" class="h3 my-3 pt-0">{{ .Title | markdownify }}</a>
|
|
<div class="mb-3 post-meta">
|
|
{{ if not .Params.HideDate }}
|
|
<span>{{ (time .Date) | time.Format (.Params.date_format | default "2 January 2006") }}</span>
|
|
{{ end }}
|
|
</div>
|
|
<p class="card-text">{{ .Summary }}</p>
|
|
<div class="d-flex justify-content-end">
|
|
<a href="{{ .Permalink }}" class="btn btn-outline-primary">{{ i18n "readMore" }}</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
{{ end }}
|
|
|
|
<div class="d-flex justify-content-center">
|
|
<a href="{{ "blog" | relLangURL }}" class="btn btn-outline-primary">{{ i18n "allPosts" }}</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- sidebar -->
|
|
{{ partial "sidebar.html" . }}
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|
|
|
|
{{ end }} |