There's this new-fangeld technology for hanging gates to an arbitrary width that we've been using on the side of the house: