Please tell me how in the single.html template I can get the first four posts from the section of the current page without this page, as well as how I can get four random posts from the current section without the current page.
I looked at the documentation and did not understand how to do it. Can somebody help with code?
{{ range (.Paginate ( first 4 .Pages.ByTitle )).Pages }} Doesn’t work with page
execute of template failed at <.Paginate>:
error calling Paginate: pagination not
supported for this page: kind: "page",
.Pages or range .Regularpages doesn’t work for me.
This works for me
{{ with ($.Site.GetPage (printf "/%s" .Section)) }}
{{ range first 4 .Pages }}
{{ .Title }}
{{ end }}
{{ end }}
But how do you get 4 pages without the current page. And how do you get randomness 4 without the current page? I saw Shuffle for random array, but how to remove current page from array?