Dynamic Fence on a Slope

Using the “standard picket fence” example for dynamic components, say I want that fence to run down a slope or a flight of stairs, how might I do this while keeping the posts and pickets vertical?