{{ $s := path.Dir (.Permalink | relURL) }} {{ $t := index (split $s "/") 2 }} {{ $o := index (split $s "/") 1 }} {{ if eq $t "post" }} {{ else if eq $o "api" }} {{ else }} {{ end }}