mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-14 17:09:45 +00:00
42 lines
1.9 KiB
HTML
42 lines
1.9 KiB
HTML
{{ define "main" }}
|
|
<div class="container markdown top-pad">
|
|
{{ .Content }}
|
|
</div>
|
|
<div class="container">
|
|
<div class="section">
|
|
<div class="columns is-multiline">
|
|
{{ $numberOfPages := len .Pages}}
|
|
{{ range .Pages.ByWeight }}
|
|
{{ if .Site.Params.projects.useTwoColumns }}
|
|
{{ .Scratch.Set "width" "490x" }}
|
|
<div class="column is-half">
|
|
{{ else }}
|
|
{{ .Scratch.Set "width" "302x" }}
|
|
<div class="column is-one-third">
|
|
{{ end }}
|
|
<div class="card">
|
|
<div class="card-image">
|
|
<figure class="image is-3by2">
|
|
<a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}">
|
|
{{ $width := ( .Scratch.Get "width" ) }}
|
|
{{ with .Resources.ByType "image" }}
|
|
{{ range first 1 (sort . "Params.weight") }}
|
|
{{ $image := .Resize $width }}
|
|
<img src="{{ $image.Permalink }}" alt ="{{ $image.Name }}">
|
|
{{ end }}
|
|
{{ end }}
|
|
</a>
|
|
</figure>
|
|
</div>
|
|
<div class="card-content has-text-centered top-pad">
|
|
<a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}">
|
|
{{ .Title }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{ end }}
|