You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hugo-theme-mini/layouts/index.html

83 lines
2.5 KiB
HTML

{{ define "main" }}
{{ partial "profile.html" . }}
<div id="list-page">
{{ $pages := where .Site.RegularPages "Params.hidden" "ne" "true" }}
{{ $paginator := .Paginate ($pages) }}
{{ range $paginator.Pages }}
{{ $title := .Title }}
{{ $summary := .Summary }}
<!-- <section class="item">
<div>
<h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
<div class="date">{{ .Date.Format "Jan 2" }}</div>
</div>
<div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
{{ with .Resources.ByType "image" }}
{{ $image := index . 1 }}
{{ range . }}
{{ if eq .Name "images/cover.png" }}
{{ $image = . }}
{{ else if eq .Name "images/cover.jpg" }}
{{ $image = . }}
{{ else if eq .Name "images/cover.jpeg" }}
{{ $image = . }}
{{ end }}
{{ end }}
<div class="cover">
<img src="{{ $image.RelPermalink }}" alt="{{ $title }}">
</div>
{{ end }}
</section> -->
<section class="item">
{{ if .Resources.ByType "image" }}
<!-- with cover image -->
{{ $images := .Resources.ByType "image" }}
{{ $image := index $images 1 }}
{{ range .Resources.ByType "image" }}
{{ if eq .Name "images/cover.png" }}
{{ $image = . }}
{{ else if eq .Name "images/cover.jpg" }}
{{ $image = . }}
{{ else if eq .Name "images/cover.jpeg" }}
{{ $image = . }}
{{ end }}
{{ end }}
<div class="left">
<h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
<div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
</div>
<div class="right">
<img src="{{ $image.RelPermalink }}" alt="{{ $title }}">
</div>
{{ else }}
<!-- no cover image -->
<div>
<h1 class="title"><a href='{{ .RelPermalink }}'>{{ $title }}</a></h1>
<div class="date">{{ .Date.Format "Jan 2" }}</div>
</div>
<div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
{{ end }}
</section>
{{ end }}
</div>
{{ end }}