The regex sub in line 9 removes the leading slash so `/2013-01-01-post` and `2013-01-01-post` are both matched as `2013-01-01-post`. If posts are in subdirectories, that path is prepended to the slug with slashes separating directories but no leading slash.