Skip to content
Snippets Groups Projects
highlight.html 1.86 KiB
Newer Older
alexisben's avatar
alexisben committed
{{ if .posts }}
  <div class="highlight">
    {{ $highlight := index .posts 0 }}
    {{ $highlight = site.GetPage (printf "/posts/%s" $highlight)}}
    {{ $list := .posts }}

    {{ with $highlight }}
      <div class="highlight-post">
alexisben's avatar
alexisben committed
        {{ partial "posts/post" (dict 
          "post" .
          "heading" "h3"
          ) }}
alexisben's avatar
alexisben committed
      </div>
    {{ end }}

    {{ with $list }}
      {{ $first := true }}
alexisben's avatar
alexisben committed
      <div class="list">
        {{ range after 1 . }}
          {{ with site.GetPage (printf "/posts/%s" .) }}
alexisben's avatar
alexisben committed
            <article class="post">
              {{- $title := partial "PrepareHTML" .Title -}}
alexisben's avatar
alexisben committed
              <h3 itemprop="headline"><a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a></h3>
alexisben's avatar
alexisben committed
              {{ if site.Params.posts.index.show_categories }}
alexisben's avatar
alexisben committed
                {{- partial "posts/categories" . -}}
              {{ end }}
alexisben's avatar
alexisben committed
              {{- if (partial "GetTextFromHTML" .Params.summary) -}}
alexisben's avatar
alexisben committed
                {{ if site.Params.posts.index.truncate_description }}
alexisben's avatar
alexisben committed
                  <p itemprop="articleBody">{{ partial "GetTruncateContent" ( dict 
alexisben's avatar
alexisben committed
                    "text" .Params.summary
alexisben's avatar
alexisben committed
                    "length" site.Params.posts.index.truncate_description
alexisben's avatar
alexisben committed
                    ) }}</p>
                {{ else }}
alexisben's avatar
alexisben committed
                  <p itemprop="articleBody">{{ partial "PrepareText" .Params.summary }}</p>
alexisben's avatar
alexisben committed
                {{ end }}
              {{- end -}}
alexisben's avatar
alexisben committed

              <div class="post-meta">
                <time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04" }}">{{ .Date | time.Format ":date_long" }}</time>
                {{ if site.Params.posts.index.show_author }}
alexisben's avatar
alexisben committed
                  {{- partial "posts/author" . -}}
alexisben's avatar
alexisben committed
                {{ end }}
              </div>
            </article>
alexisben's avatar
alexisben committed
          {{ end }}
        {{ end }}
      </div>
    {{ end }}
  </div>
{{ end }}