1 vote

Trimming lastSegment from a URI trims that PLUS the last number of the previous segment

{{ entry.url|split('/')[:-1]|join('/') }} This splits the url string into an array, uses the syntactic sugar version of the slice filter to cut the last item off, then joins them back together as a ...
Brimby's user avatar
  • 343

Only top scored, non community-wiki answers of a minimum length are eligible