I’m ranging over the 10 latest blog posts via .Site.Pages
. This partial is rendered at the and of a blog post. It can happen that the current blog post is one of the latest 10. Therefore I would like to ignore this blog post. My problem is that I can’t get the url of the current element/page in .Site.Pages
.
The current state of my code (which excludes the about page):
<ul id="post-list" class="archive readmore">
{{ range first 10 .Site.Pages }}
# Get relative page url like about/
{{ $url := replace .Permalink (printf "%s" .Site.BaseURL) "" }}
{{ if ne $url "about/" }}
# Do Something
{{ end }}
{{ end }}
</ul>
The condition might look like {{ if and (ne $url "about/") (ne $url RelativeURLToCurrentPage) }}