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

author_articles_list.html « author « partials « layouts - github.com/forestryio/hugo-theme-novela.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1c08bb04b10acaa8fe881c4e4b0b8357ffcd0da (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
<section class="section nartrow author-alc-section">
    <div id="articlesList" class="articles-list-container show-details author-alc">
        {{ $scratch :=newScratch }}
        {{ $scratch.Set "authorName" .Page.Params.name }}
        {{ $scratch.Set "biggerFirst" true }}
        {{ $scratch.Set "biggerPlaced" false }}
        <div class="post-row-alt">
            {{ range $index, $article := where .Site.RegularPages "Type" "post" }}

                {{ $scratch.Set "authorMatch" false }}
                {{ range $author := $article.Params.authors }}
                    {{ $authorPage := $.Site.GetPage $author }}

                    {{ if eq $authorPage.Params.name ($scratch.Get "authorName") }}
                        {{ $scratch.Set "authorMatch" true }}
                    {{ end }}
                {{ end }}

                {{ $counter := mod $index 2 }}
                {{ if eq ($scratch.Get "authorMatch") true }}
                    <a href="{{ $article.Permalink }}" class="article-link">
                      <div class="article-data-outer">
                        <div class="image-container">
                          <img src="{{ $article.Params.hero }}" class="article-image" /> 
                        </div>
                        <div class="article-data">
                          <h2 class="article-title">
                            {{ $article.Params.title }}
                          </h2>
                          <p class="article-excerpt">
                            {{ $article.Params.excerpt }}
                          </p>
                          <div class="article-metadata">
                            {{ $article.Date.Format "January 2, 2006" }}{{ if $article.Params.timetoread }} • {{ $article.Params.timetoread }} min read{{ end }}
                          </div>
                        </div>
                      </div>
                    </a>
                    {{ $counter := mod (add $index 1) 2 }}
                    {{ $len := (where .Pages "Type" "posts") }}
                {{ end }}
            {{ end }}
        </div>
    </div>
    
    <nav aria-label="Page navigation">
        <ul class="pagination">
            <li class="page-item active"><a href="/" class="page-link">1</a></li>
            <li class="page-item"><a href="/page/2/" class="page-link">2</a></li>
            <li class="page-item"><a href="/page/3/" class="page-link">3</a></li>
            <li class="page-item"><a href="/page/2/" rel="next" class="page-link page-next">Next</a></li>
        </ul>
    </nav>

</section>

{{ $script := resources.Get "js/toggleBorder.js" }}
<script src="{{ $script.Permalink }}"></script>