Layout generator does not work properly when site is in a sub-directory