{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $.Scratch.Delete "path" }} {{ $.Scratch.Add "path" .Site.BaseURL }} {{ $count := len (split $url "/") }}