Skip to content
Snippets Groups Projects
large.html 2.24 KiB
Newer Older
Olivia206's avatar
Olivia206 committed
{{ $heading_level := .heading_level | default 3 }}
{{ $heading := printf "h%d" $heading_level }}

<div class="large">
  {{ range $project := .projects -}}
    {{ with site.GetPage .file }}

        {{ $heading_tag := (dict 
            "open" ((printf "<%s class='project-title' itemprop='name'>" $heading) | safeHTML)
            "close" ((printf "</%s>" $heading) | safeHTML)
        ) }}

        <article class="project" itemscope itemtype="https://schema.org/CreativeWork">
          <div class="project-content">
            <div class="project-description">
              {{- $title := partial "PrepareHTML" .Title -}}
              
              {{ $heading_tag.open }}
                <a href="{{ .Permalink }}" itemprop="url" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" $title)) }}">{{ $title }}</a>
              {{ $heading_tag.close }}
              
              {{ if and site.Params.projects.index.show_description (partial "GetTextFromHTML" .Params.summary) }}
                <p itemprop="abstract">{{ partial "GetTruncateContent" ( dict 
                  "text" .Params.summary
                  "length" site.Params.projects.index.truncate_description
                  ) }}
                </p>
              {{ end }}
              <div class="project-meta">
                {{ if and site.Params.projects.index.show_year .Params.year }}
                  <time itemprop="datePublished" datetime="{{ .Params.year }}">{{ .Params.year }}</time>
                {{ end }}
                {{ if site.Params.projects.index.show_categories }}
                  {{- partial "projects/categories" . -}}
                {{ end }}
              </div>
              <p class="more meta" aria-hidden="true">{{- i18n "commons.more" -}}</p>
            </div>
          </div>
      
          <div class="media">
            {{- if .Params.image -}}
              {{- partial "commons/image.html"
                  (dict
                    "image"    .Params.image
                    "sizes"    site.Params.image_sizes.sections.projects.item
                  ) -}}
            {{- else -}}
              {{- partial "commons/image-default.html" "projects" -}}
            {{- end -}}
          </div>
      
      </article>
    {{ end }}
  {{ end }}
</div>