I am trying to add images to accompany the title and summaries of blogs when I enter the “Test2” blogs tab. Currently it only displays the summary and the title.
The entire code can be found on github:
Below is how the _default list.html looks which I am assuming to be what powers the structure of
list of blogs
{{ define "main" }}
<article class="pa3 pa4-ns nested-copy-line-height nested-img">
<section class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy mid-gray">
{{- .Content -}}
</section>
<section class="flex-ns flex-wrap justify-around mt5">
{{ range .Paginator.Pages }}
<div class="relative w-100 w-30-l mb4 bg-white">
{{- partial "summary.html" . -}}
</div>
{{ end }}
</section>
{{- template "_internal/pagination.html" . -}}
</article>
{{ end }}
It seems the “summary.html” is responsible for the layout of “test2”,
so I tried to display the image that is displayed within each blog, in the summary.html as well,
to create a thumbnail for each summary, but it doesn’t seem to have an effect. So I am not sure what I am doing wrong:
{{ $featured_image := .Params.featured_image }}
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">{{ humanize .Section }}</span>
<h1 class="f3 near-black">
<a href="{{ .URL }}" class="link black dim">
{{ .Title }}
</a>
</h1>
<img img src="{{$featured_image}}" alt="">
<div class="nested-links f5 lh-copy nested-copy-line-height">
{{ .Summary }}
</div>
</div>
</div>