Blog

Blog

15. Feb 2017

Get last and first element in a URL

While working on this website with HUGO I needed the first and last element of the current URL in variables at some point. There is a snippet available to get the last element in a URL that does some delimit and split magic. When looking into how to get the first element I came up with another way to also get the last element that might be a bit more understandable.