squirrel/layouts/partials/links.html

53 lines
No EOL
1.7 KiB
HTML

{{- $links := .links }}
{{- $odd := .odd }}
{{- $defaultimage := .defaultimage}}
{{- $id := "links"}}
{{if $links.id}}
{{- $id := $links.id}}
{{else if .id}}
{{- $id := .id }}
{{end}}
<div id="{{ $id }}" class="section {{if eq $odd 0}} section-even {{end}}">
<div class="section-content">
{{ with $links.title }}
<div class="title">
<h1 class="content-title">{{ . }}</h1>
<div class="divider"></div>
</div>
{{ end }}
<div class="cardList">
{{- range $links.links}}
<div class="mediumCard">
<a href="{{ .url }}">
<div class="cardContent">
{{ if .image }}
<img class="cardImage {{ if eq .image.cover false }} noCover {{ end }}" alt="{{ .image.alt }}" src="{{ .image.url }}" />
{{ else if .icon }}
<div class="cardImage">
<i class="fas fa-{{ .icon }} cardIcon"></i>
</div>
{{ else }}
<img class="cardImage" alt="default image" src="{{ $defaultimage }}" />
{{ end }}
<div class="cardTitle">{{ .title }}</div>
</div>
</a>
</div>
{{/* <a href="{{ .url }}">
<div class="mediumCard">
{{ if .image }}
<img class="cardImage" alt="{{ .image.alt }}" src="{{ .image.url }}" />
{{ else if .icon }}
<div class="cardImage">
<i class="fas fa-{{ .icon }} cardIcon"></i>
</div>
{{ else }}
<img class="cardImage" alt="default image" src="{{ $defaultimage }}" />
{{ end }}
<div class="cardTitle">{{.title}}</div>
</div>
</a> */}}
{{- end}}
</div>
</div>
</div>