Breadcrumbs without current page?

I am working an the blog part of my website and want to add breadcrumbs to the page so visitors can see where they are on the site structure.

Currently I have the following code in my partial folder and is working fine but it’s also showing me the current page I’m on and this is what I don’t wand.

Does any of you know how to remove the current page from the path.

<a href="/">Home</a>
{{ range (split .URL "/") }}
    {{ if gt (len . ) 0 }}
        / <a href="/{{ . }}">{{ humanize (replace . "posts" "blog") }}</a>
    {{ end }}
{{ end }}
<a href="/">Home</a>
{{ $items := split (trim .RelPermalink "/") "/" }}
{{ range first (sub (len $items) 1) $items }}
  / <a href="/{{ . }}">{{ humanize (replace . "posts" "blog") }}</a>
{{ end }}

absolutly perfect, thank you for the help now I can finally finish up the portion of the blog for my project.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.