No output from Related Content

Had high expectations with Related Content from release 0.27. But so far it has been impossible to get any output from the new feature during my tests.

I’ve likely missed something stupid. So be it!

My code-blok goes like this:

<div id="related">
	{{ $related := .Site.RegularPages.Related . | first 5 }}
	{{ with $related }}
	{{ $domain := .Params.site }}
	<span class="icon icon-bubbles"> </span><span class="title"> {{ T "relatedLabel" }} </span>
	<ul>
		{{ range . }}
		<li>- <a class="archive-article-title" href="https://{{ $domain }}/{{ .Permalink }}">{{ .Title }}</a></li>
		{{ end }}
	</ul>
	{{ end }}
</div>
  1. Figured that .Params.site might be outside scope in the range-iteration, but declaring it outside - like above - didn’t help.
  2. Have testet the code from theme\layouts\partials\widgets\related.html, from theme\layouts\partials\sidebarleft.html and directly from theme\layouts\_default\single.html - but no output apart from <div id="related"></div>.

I’m using release 0.27.1 and a further development of theme Nixon.

Does anyone have a clue?

Not sure why you mess around with the “domain part”, if you want absolute URLs then .Permalink should do alone.

As to your other problem; You have to show the whole thing, i.e. a full failing project for us to be able to help you. I cannot guess how your config looks, etc.

I should testet without making any changes to the code-example from the release-page. Sorry for that.

{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>See Also</h3>
<ul>
	{{ range . }}
	<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
	{{ end }}
</ul>
{{ end }}

Still. Using the code from above unaltered in a partials/widget doesn’t change anything. The output continues to be just empty space wrapped in my div around the code - and no errors.

What could possibly go wrong here?

Again: You are suggesting that I’m able to somehow guess how your project is configured/looks like.

See above.

Just as predicted: The missing output was due to a real stupid mistake, that’s not suited for further description here.

Bottom line: After a small correction everything now works just perfect in my setup.

But in general it’s a real good idea to read the docs to the end. Doing that in this case you’ll bump into the configuration part of related content…

…Thank you for your patience…:wink: