My old garden gate had seen better days and was no longer capable of keeping pets on one side of it, so it was time for a rebuild!

The first step was to pull the old gate out and take some measurements:

The bottom of the wood is pretty green, but all of the timber is old and loose! The latch is in the top right (This picture and the first one are taken from the same orientation - hinges on the left, top on the top.)
On the bottom of the frame, on the right is a clear imprint of a hinge, and on the left is what I suspect is an old latch mount point. In other words, this gate has been here so long it has been taken out and flipped upside down!
One I knew what I was building, the first step was to rebuild the frame. It's fairly simple construction - a rectangle with a diagonal brace:

I started by building a square frame, notching out the uprights to provide support. I used treated pine screws, two per corner, running right to left in the following picture:

Then, with the outer rectangle complete, I placed the brace piece over it and traced the inside angles. This allowed me to get a good fit, without careful measurement or complex calculation of angles. I used a mitre saw and band saw to do my cuts, but a jigsaw would also work perfectly. I added two more screws, one from the left and one from the underside, to hold the brace in place.

After building the frame, it was time to hang it. Typically you'd make the entire gate and hang it at the end, as it's much easier to add the palings when it's lying down (and not swinging on its hinges!) Because I was going onto existing hinges, instead of replacing them, I preferred to mount the frame and then add my palings a precise distance from the ground. Again, this saved careful measuring.

Note that the top of the diagonal is away from the hinges. Think of it like the diagonal of a bookshelf - you want it to hold up the top of the frame, as this is where most of the pressure will be.
After mounting, I added the palings. My gate was about 900mm wide, and I used 8x100mm palings. To figure out the spacing, I simply took the width of the gate (900), subtracted the total width of the palings (800) and then divided the remaining width by the number of spaces (8 palings so 7 spaces): 900-800 = 100, 100 / 7 = 14mm per gap.
I cut some offcuts from my frame to be the width of the space and paling by paling, clamped them in place with spacers top and bottom. I fixed the palings in place with 3 screws - one in the top of the frame, one in the bottom and one in the brace. I used a similar trick for the spacing at the bottom of the gate:

It's far more common to use a nail gun than screws for this, but I didn't have one available - screws worked perfectly!
When fixing the palings, I started at the latch side - this is the side that everyone will see, so it's the one you want to line up perfectly. On the hinge side - which no one will ever look at I was about 10mm short of perfectly lining up, likely because not all the palings were perfectly 100mm, or perfectly straight.
The last step was to mount the latch. Again, I reused the existing one. Installation was simple - drill a hole for the shaft, then screw the handles on each side and the support in a rough position.
It's more common to put the main part of the latch on the frame side (and if you look at the picture of the old gate, that is where it is) however because of some movement in the fence over time, the gate closed much more evenly with the fence with the latch on the paling side.

I will probably paint the gate as a next step, to extend its lifetime. I may even rebuild it (along with the fence it connects to!) with a nicer exterior timber such as merbau.