Shortcode:
<div class="related">
{{ $related := .Site.RegularPages.Related . | first 2 }}
{{ with $related }}
<div class="row">
{{ range . }}
<div class="col-md-3 col-sm-6">
<div class="box-image-text shadow" style="height: 280px;">
<div class="top">
<div class="image" style="overflow:hidden">
<a href="{{ .RelPermalink }}">
{{ if isset .Params "banner" }}
<img src="{{ .Site.BaseURL}}img/placeholder.png" data-src="{{ .Site.BaseURL}}{{ .Params.banner }}" class="img-responsive shadow" alt="{{.Title}}" width="255" height="192" title="{{.Title}}">
{{ else }}
<img src="{{ .Site.BaseURL}}img/placeholder.png" class="img-responsive" alt="{{.Title}}" width="255" height="192" title="{{.Title}}">
{{ end }}
<h4>{{ .Title }}<h4>
</a>
</div>
</div>
</div>
</div>
{{ end }}
</div>
{{ end }}
</div>
Markdown Content calling shortcode:
{{< related >}}
Hugo build error:
shortcodes/related.html:2:46: executing "shortcodes/related.html" at <.>: wrong type for value; expected related.Document; got *hugolib.ShortcodeWithPage
Total in 784 ms
Error: Error building site: logged 1 error(s)
I am not understanding why there is the wrong type for the value. What is the type for this? And how can I give the correct type?