Welcome to mirror list, hosted at ThFree Co, Russian Federation.

recent_posts.html « partials « layouts - github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5add1e877cb5154ca3ff53991db23a8cff6422f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{{ if isset .Site.Params "recent_posts" }}
{{ if .Site.Params.recent_posts.enable }}
<section class="bar background-white no-mb">
    <div class="container">

        <div class="col-md-12">
            <div class="heading text-center">
                <h2>{{ .Site.Params.recent_posts.title | markdownify }}</h2>
            </div>

            <p class="lead">
              {{ .Site.Params.recent_posts.subtitle | markdownify }}
            </p>

            <!-- *** BLOG HOMEPAGE *** -->

            <div class="row">
                {{ $posts := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
                {{ range first 4 $posts.Pages }}
                <div class="col-md-3 col-sm-6">
                    <div class="box-image-text blog">
                        <div class="top">
                            <div class="image" style="overflow:hidden">
                                {{ if isset .Params "banner" }}
                                <img src="{{ .Params.banner | relURL }}" class="img-responsive" alt="" >
                                {{ else }}
                                <img src="{{ "img/placeholder.png" | relURL }}" class="img-responsive" alt="">
                                {{ end }}
                            </div>
                            <div class="bg"></div>
                            <div class="text">
                                <p class="buttons">
                                    <a href="{{ .Permalink }}" class="btn btn-template-transparent-primary"><i class="fas fa-link"></i> {{ i18n "readMore" }}</a>
                                </p>
                            </div>
                        </div>

                        <div class="content">
                            <h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
                            <p class="author-category">
			    {{ if isset .Params "authors" }}
			      {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relLangURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }}
                            {{ end }}
                            {{ if .Params.date }}
                                {{ $createdAt := .Date.Format .Site.Params.date_format }}
                                {{ range $index, $month := slice "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December" }}
                                    {{ $createdAt = replace $createdAt $month (i18n $month) }}
                                {{ end }}
                                {{ i18n "publishedOn" }} {{ $createdAt }}
                            {{ end }}
                            </p>
                            {{ if not .Site.Params.recent_posts.hide_summary }}
                            <p class="intro">{{ .Summary }}</p>
                            <p class="read-more">
                              <a href="{{ .Permalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a>
                            </p>
                            {{ end }}
                        </div>
                    </div>
                    <!-- /.box-image-text -->

                </div>
                {{ end }}

            </div>
            <!-- /.row -->

            <!-- *** BLOG HOMEPAGE END *** -->

        </div>
    </div>
    <!-- /.container -->
</section>
<!-- /.bar -->
{{ end }}
{{ end }}