doc: fix out-of-tree build from git
tested working locally. it would be very slightly faster to run dirname once instead of twice but the difference is negligible
tested working locally. it would be very slightly faster to run dirname once instead of twice but the difference is negligible