index.html 2.17 KB
Newer Older
1 2
{{ define "main" }}
  <div role="main" class="container">
3 4 5 6 7
    {{ with .Content }}
    <div class="jumbotron">
      {{.}}
    </div>
    {{ end }}
8 9 10 11 12 13 14 15 16 17 18 19 20
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <div class="posts-list">
          {{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
          {{ range first 3 $pag.Pages }}
            <article class="post-preview">
              <a href="{{ .Permalink }}">
                <h2 class="post-title">{{ .Title }}</h2>
                {{ if .Params.subtitle }}
                  <h3 class="post-subtitle">
                  {{ .Params.subtitle }}
                  </h3>
                {{ end }}
21 22 23 24 25 26
                {{ if .Params.image }}
                <img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" />
                {{ end }}
                {{ if .Params.video }}
                <video src="{{ .Params.video }}" loop autoplay muted playsinline class="img-title" />
                {{ end }}
27 28 29 30 31
              </a>

              {{ partial "post_meta.html" . }}
              <div class="post-entry">
                {{ if .Truncated }}
32
                  {{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary | plainify | htmlUnescape }}{{ end }}
33 34 35 36 37 38 39 40 41 42 43 44 45
                  <a href="{{ .Permalink }}" class="post-read-more">[{{ i18n "readMore" }}]</a>
                {{ else }}
                  {{ .Content }}
                {{ end }}
              </div>
            </article>
          {{ end }}
        </div>

        {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
          <ul class="pager main-pager">
            {{ if .Paginator.HasPrev }}
              <li class="previous">
46
                <a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
47 48 49 50
              </li>
            {{ end }}
            {{ if .Paginator.HasNext }}
              <li class="next">
51
                <a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
52 53 54 55 56 57 58 59
              </li>
            {{ end }}
          </ul>
        {{ end }}
      </div>
    </div>
  </div>
{{ end }}