CHANGE image handling, ADD partials to reuse structure, REFACTOR
This commit is contained in:
parent
1265491dee
commit
01dcf04b8a
36 changed files with 1181 additions and 864 deletions
|
@ -1,11 +1,7 @@
|
|||
{{ define "main" }}
|
||||
<div class="content">
|
||||
<article>
|
||||
<div class="title">
|
||||
<h1 class="content-title">{{ .Title }}</h1>
|
||||
<div class="divider"></div>
|
||||
</div>
|
||||
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
|
||||
{{ partial "components/title.html" .Title }}
|
||||
{{.Content}}
|
||||
</article>
|
||||
<!-- Ranges through content/posts/*.md -->
|
||||
|
@ -15,9 +11,10 @@
|
|||
<a href="{{.Permalink}}">
|
||||
<div class="cardContent">
|
||||
{{ if .Params.image }}
|
||||
<img class="cardImage {{ if eq .Params.image.cover false }} noCover {{ end }}" alt="{{ .Params.image.alt }}" src="{{ .Params.image.url }}" />
|
||||
{{ $style := "cardImage {{if ne .Params.image.cover }} noCover {{ end }}" }}
|
||||
{{- partial "components/image.html" (dict "style" $style "url" .Params.image.url "alt" .Params.image.alt) -}}
|
||||
{{ else }}
|
||||
<img class="cardImage" src="{{ .Site.Params.defaultimage }}" alt="Default Image" />
|
||||
{{- partial "components/image.html" (dict "style" "cardImage" "url" .Site.Params.defaultimage "alt" "Placeholder") -}}
|
||||
{{ end }}
|
||||
<div class="cardTitle">{{.Title}}</div>
|
||||
<div class="cardDescription">{{ .Summary | safeHTML | truncate 320 }}</div>
|
||||
|
@ -28,4 +25,4 @@
|
|||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue