Skip to content

Instantly share code, notes, and snippets.

@budparr
Created January 12, 2017 14:33
Show Gist options
  • Select an option

  • Save budparr/e00b164bf4a54ca2cffa04bdf6e63aba to your computer and use it in GitHub Desktop.

Select an option

Save budparr/e00b164bf4a54ca2cffa04bdf6e63aba to your computer and use it in GitHub Desktop.
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ol class="breadcrumbs">
<li><a href="/">home</a></li>
{{ range $index, $element := split $url "/" }}
{{ $.Scratch.Add "path" $element }}
{{ if ne $element "" }}
<li><a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a></li>
{{ $.Scratch.Add "path" "/" }}
{{ end }}
{{ end }}
</ol>
@pritammeta
Copy link
Copy Markdown

It displays list but breadcrumbs are not list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment